my code stock.com

tari

Snippet options

Download: Download snippet as fichas.php.
Copy snippet: For this you need a free my code stock.com account.
Embed code : You will find the embed code for this snippet at the end of the page, if you want to embed it into a website or a blog!

$context['inforows'] = array();
	$inforows = array();
	$request = $smcFunc['db_query']('', '
		SELECT id_serie, nombre, caratula, banner, sinopsis, estado
		FROM {db_prefix}series_ficha
		'.$condicion.'
		ORDER BY '.$sort_methods[$_REQUEST['sort']][$context['sort_direction']] .'',
		array()
	);
	while($row = $smcFunc['db_fetch_assoc']($request))
	{
		  $inforows = &$context['inforows'][]; 
		  $inforows['id_serie'] = $row['id_serie'];
          $inforows['nombre'] = $row['nombre'];
          $inforows['caratula'] = !empty($row['caratula']) ? $row['caratula'] : "";
		  $inforows['banner'] = !empty($row['banner']) ? $row['banner'] : "";
		  $inforows['sinopsis'] = !empty($row['sinopsis']) ? $row['sinopsis'] : "";				
		  $inforows['estado'] = estadosDisponibles($row['estado']);
		  $inforows['edit'] = '<a href="'. $scripturl .'?action=admin;area=fichas;sa=edit;id='. $inforows['id_serie'] .';sesc=' . $context['session_id'].'"><img src="'. $settings['default_images_url'] . '/buttons/modify.gif"  alt="'. $txt['admin_series_editar'] .'" title="'. $txt['admin_series_editar'] .'"/></a>';
		  $inforows['delete'] = '<a  style="color:red" onclick="return makesurelink()" href="'. $scripturl .'?action=admin;area=fichas;sa=delete;id='. $inforows['id_serie'] .';sesc=' . $context['session_id'].'"><img src="'. $settings['default_images_url'] . '/buttons/delete.gif" alt="'. $txt['admin_series_borrar'] .'" title="'. $txt['admin_series_borrar'] .'"/></a>';	
		
		$request2 = $smcFunc['db_query']('', '
		SELECT id_serie, tipo
		FROM {db_prefix}series_versiones
		WHERE id_serie = {int:id_serie}',
			array(
			  'id_serie' => $row['id_serie'],
			)
		);
		if ($from = 'admin')
		{
			$agregar_tecnico_1 = '<a href="'. $scripturl .'?action=admin;area=fichas;sa=addtecnico;id_serie='.$inforows['id_serie'].';tipo=1">Agregar</a>';
			$agregar_tecnico_2 = '<a href="'. $scripturl .'?action=admin;area=fichas;sa=addtecnico;id_serie='.$inforows['id_serie'].';tipo=2">Agregar</a>';
			$agregar_tecnico_3 = '<a href="'. $scripturl .'?action=admin;area=fichas;sa=addtecnico;id_serie='.$inforows['id_serie'].';tipo=3">Agregar</a>';
			$agregar_tecnico_4 = '<a href="'. $scripturl .'?action=admin;area=fichas;sa=addtecnico;id_serie='.$inforows['id_serie'].';tipo=4">Agregar</a>';
			
			while($row = $smcFunc['db_fetch_assoc']($request2))
			{
				
				$editar_tecnico = '<a href="'. $scripturl .'?action=admin;area=fichas;sa=edittecnico;id_serie='.$inforows['id_serie'].';tipo='.$row['tipo'].'">Editar</a>';				
				$inforows['tipo_1'] = ($row['tipo'] == 1) ? $editar_tecnico : $agregar_tecnico_1;
				$inforows['tipo_2'] = ($row['tipo'] == 2) ? $editar_tecnico : $agregar_tecnico_2;
				$inforows['tipo_3'] = ($row['tipo'] == 3) ? $editar_tecnico : $agregar_tecnico_3;
				$inforows['tipo_4'] = ($row['tipo'] == 4) ? $editar_tecnico : $agregar_tecnico_4;
			}
			$smcFunc['db_free_result']($request2);
			
			$inforows['tipo_1'] = (empty($inforows['tipo_1'])) ? $agregar_tecnico_1 : $inforows['tipo_1'];
			$inforows['tipo_2'] = (empty($inforows['tipo_2'])) ? $agregar_tecnico_2 : $inforows['tipo_2'];
			$inforows['tipo_3'] = (empty($inforows['tipo_3'])) ? $agregar_tecnico_3 : $inforows['tipo_3'];
			$inforows['tipo_4'] = (empty($inforows['tipo_4'])) ? $agregar_tecnico_4 : $inforows['tipo_4'];
				
		}
	}	 
	$smcFunc['db_free_result']($request);

Create a free my code stock.com account now.

my code stok.com is a free service, which allows you to save and manage code snippes of any kind and programming language. We provide many advantages for your daily work with code-snippets, also for your teamwork. Give it a try!

Find out more and register now

You can customize the height of iFrame-Codes as needed! You can find more infos in our API Reference for iframe Embeds.