<?php
function clave($idconcepto)
{
$sql="SELECT concat(p.inicial, d.no_depto, substring(e.nombre,1,2), substring(e.a_pat,1,1), c.dia_inicio, c.dia_salida) as clave from conceptos as c INNER JOIN complejo as p ON p.id_complejo=c.id_complejo INNER JOIN clientes as cl ON cl.id_cliente=c.id_cliente INNER JOIN departamentos as d ON d.id_departamento=c.id_departamento INNER JOIN empleados as e ON e.id_empleado=cl.id_emp where c.id_concepto='$idconcepto'";
$query=mysql_query($sql);
$array=mysql_fetch_array($query);
return($array["clave"]);

}?>