Advertisement
Guest User

Untitled

a guest
May 2nd, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.53 KB | None | 0 0
  1. <?php
  2. class MySQL {
  3. /**
  4. * MySQL server hostname
  5. * @access private
  6. * @var string
  7. */
  8. var $host;
  9.  
  10. /**
  11. * MySQL username
  12. * @access private
  13. * @var string
  14. */
  15. var $dbUser;
  16.  
  17. /**
  18. * MySQL user's password
  19. * @access private
  20. * @var string
  21. */
  22. var $dbPass;
  23.  
  24. /**
  25. * Name of database to use
  26. * @access private
  27. * @var string
  28. */
  29. var $dbName;
  30.  
  31. /**
  32. * MySQL Resource link identifier stored here
  33. * @access private
  34. * @var string
  35. */
  36. var $dbConn;
  37.  
  38. /**
  39. * Stores error messages for connection errors
  40. * @access private
  41. * @var string
  42. */
  43. var $connectError;
  44.  
  45. /**
  46. * MySQL constructor
  47. * @param string host (MySQL server hostname)
  48. * @param string dbUser (MySQL User Name)
  49. * @param string dbPass (MySQL User Password)
  50. * @param string dbName (Database to select)
  51. * @access public
  52. */
  53.  
  54. var $transaccion;
  55.  
  56. function MySQL () {
  57. /*
  58. $host = 'localhost';
  59. $dbUser = 'root';
  60. $dbPass = '';
  61. $dbName = 'rectoria_news';
  62. */
  63.  
  64. $host = 'localhost';
  65. $dbUser = 'root';
  66. $dbPass = '1234';
  67. $dbName = 'unioncamioneros2';
  68.  
  69. $this->host=$host;
  70. $this->dbUser=$dbUser;
  71. $this->dbPass=$dbPass;
  72. $this->dbName=$dbName;
  73. $this->connectToDb();
  74. }
  75.  
  76. /**
  77. * Establishes connection to MySQL and selects a database
  78. * @return void
  79. * @access private
  80. */
  81. function connectToDb ()
  82. {
  83. // Make connection to MySQL server
  84. if (!$this->dbConn = @mysql_connect($this->host,
  85. $this->dbUser,
  86. $this->dbPass)) {
  87. trigger_error('Could not connect to server');
  88. $this->connectError=true;
  89. // Select database
  90. } else if ( !@mysql_select_db($this->dbName,$this->dbConn) ) {
  91. trigger_error('Could not select database');
  92. $this->connectError=true;
  93. }
  94. }
  95.  
  96. function Transaccion()
  97. {
  98. $this->transaccion = new Transaccion($this->dbConn);
  99. }
  100.  
  101. /**
  102. * Checks for MySQL errors
  103. * @return boolean
  104. * @access public
  105. */
  106. function isError ()
  107. {
  108. if ( $this->connectError )
  109. return true;
  110. $error=mysql_error ($this->dbConn);
  111. if ( empty ($error) )
  112. return false;
  113. else
  114. return true;
  115. }
  116.  
  117. /**
  118. * Returns an instance of MySQLResult to fetch rows with
  119. * @param $sql string the database query to run
  120. * @return MySQLResult
  121. * @access public
  122. */
  123. function & query($sql)
  124. {
  125. if (!$queryResource=mysql_query($sql,$this->dbConn))
  126. {
  127. trigger_error ('Query failed: '.mysql_error($this->dbConn).' SQL: '.$sql);
  128. }
  129.  
  130. return new MySQLResult($this,$queryResource);
  131. }
  132.  
  133.  
  134.  
  135.  
  136. }//end class mysql
  137.  
  138. /**
  139. * MySQLResult Data Fetching Class
  140. * @access public
  141. * @package SPLIB
  142. */
  143. class MySQLResult
  144. {
  145. /**
  146. * Instance of MySQL providing database connection
  147. * @access private
  148. * @var MySQL
  149. */
  150. var $mysql;
  151.  
  152. /**
  153. * Query resource
  154. * @access private
  155. * @var resource
  156. */
  157. var $query;
  158.  
  159. /**
  160. * MySQLResult constructor
  161. * @param object mysql (instance of MySQL class)
  162. * @param resource query (MySQL query resource)
  163. * @access public
  164. */
  165. function MySQLResult(& $mysql,$query)
  166. {
  167. $this->mysql=& $mysql;
  168. $this->query=$query;
  169. }
  170.  
  171. /**
  172. * Fetches a row from the result
  173. * @return array
  174. * @access public
  175. */
  176. function fetch ()
  177. {
  178. if ( $row=mysql_fetch_array($this->query,MYSQL_ASSOC) )
  179. {
  180. return $row;
  181. } else if ( $this->size() > 0 )
  182. {
  183. mysql_data_seek($this->query,0);
  184. return false;
  185. } else
  186. {
  187. return false;
  188. }
  189. }//end fetch
  190.  
  191. function fetchRow()
  192. {
  193. if ( $row=mysql_fetch_row($this->query) )
  194. {
  195. return $row;
  196. } else if ( $this->size() > 0 )
  197. {
  198. mysql_data_seek($this->query,0);
  199. return false;
  200. } else
  201. {
  202. return false;
  203. }
  204. }//end fetchRow
  205.  
  206.  
  207. /**
  208. * Returns the number of rows selected
  209. * @return int
  210. * @access public
  211. */
  212. function size ()
  213. {
  214. return mysql_num_rows($this->query);
  215. }
  216. /**
  217. * Returns the number of rows affected
  218. * @return int
  219. * @access public
  220. */
  221. function affectedRows ()
  222. {
  223. return mysql_affected_rows($this->mysql->dbConn);
  224. }
  225.  
  226. /**
  227. * Returns the ID of the last row inserted
  228. * @return int
  229. * @access public
  230. */
  231. function insertID ()
  232. {
  233. return mysql_insert_id($this->mysql->dbConn);
  234. }
  235.  
  236. /**
  237. * Checks for MySQL errors
  238. * @return boolean
  239. * @access public
  240. */
  241. function isError ()
  242. {
  243. return $this->mysql->isError();
  244. }
  245. }//end mysqlResult
  246.  
  247. /**********************************************************************************/
  248. /* Transacciones con PHP - MYSQL */
  249. /**********************************************************************************/
  250.  
  251. class Transaccion/* Nombre de la clase */
  252. {
  253.  
  254. private $Cnn; /* Variable de conexxion */
  255.  
  256. /****************************************/
  257. function Transaccion($Con)
  258. {
  259. //mysql_disconnect($this->Cnn); /* Desconecta la conexion a la BD */
  260. $this->Cnn=$Con;
  261. //
  262. }
  263.  
  264. /****************************************/
  265. function begin()
  266. {
  267. mysql_query("BEGIN",$this->Cnn); /* Abre la transaccion */
  268. }
  269.  
  270. /****************************************/
  271. function rollback()
  272. {
  273. mysql_query("ROLLBACK",$this->Cnn); /* Deshace la transaccion */
  274. }
  275.  
  276. /****************************************/
  277. function commit()
  278. {
  279. mysql_query("COMMIT ", $this->Cnn); /* Ejecuta la transaccion */
  280. }
  281. }//end Class
  282.  
  283. ?>
  284. <?
  285. class Precio
  286. {
  287. private $db;
  288.  
  289. function Precio(&$db)
  290. {
  291. $this->db=&$db;
  292. }
  293.  
  294. function lsPrecios()
  295. {
  296. $SQL="SELECT * FROM precios";
  297. $resultado=$this->db->query($SQL);
  298. return $resultado;
  299. }
  300.  
  301. function registrarPrecio($kilometro,$precio)
  302. {
  303. $e = false;
  304. $this->db->Transaccion();
  305. $this->db->transaccion->begin();
  306.  
  307. $SQL="INSERT INTO precios SET kilometro=".$kilometro.",
  308. precio=".$precio."";
  309.  
  310. $resultado=$this->db->query($SQL);
  311. if($resultado->affectedRows()>0)
  312. $e = true;
  313.  
  314. if($e)
  315. $this->db->transaccion->commit();
  316. else
  317. $this->db->transaccion->rollback();
  318. }
  319. function actualizarPrecio($datos)
  320. {
  321. $e = false;
  322. $this->db->Transaccion();
  323. $this->db->transaccion->begin();
  324.  
  325. $id_precio=trim($datos['txtid_precio']);
  326. $precio=trim($datos['_txtprecio']);
  327.  
  328. $SQL="UPDATE precios SET precio=".$precio." WHERE id_precio=".$id_precio."";
  329.  
  330. echo "La sentencia es la siguiente: ".$SQL;
  331.  
  332. $resultado=$this->db->query($SQL);
  333. if($resultado->affectedRows()>0)
  334. $e = true;
  335.  
  336. if($e)
  337. $this->db->transaccion->commit();
  338. else
  339. $this->db->transaccion->rollback();
  340. }
  341.  
  342.  
  343. function buscarPrecio($datos)
  344. {
  345. $id_precio=trim($datos['id']);
  346.  
  347. $SQL="SELECT * FROM precios WHERE id_precio=".$id_precio."";
  348. $resultado=$this->db->query($SQL);
  349. return $resultado;
  350. }
  351.  
  352.  
  353. function buscarValor($kilometros,$capacidad)
  354. {
  355. $precio=0;
  356. $SQL="SELECT precio FROM precios WHERE kilometro=".$kilometros."";
  357. $resultado=$this->db->query($SQL);
  358. while($rec=$resultado->fetch())
  359. {
  360. $precio=$rec['precio'];
  361. }
  362. if($capacidad==14)
  363. {
  364. $precio=$precio*2;
  365. }
  366. return $precio;
  367.  
  368. }
  369.  
  370. }//
  371. ?>
  372.  
  373. <?php
  374. class Factura
  375. {
  376.  
  377. var $db;
  378. var $id_generado;
  379.  
  380. function Factura(&$Con)
  381. {
  382. $this->db=&$Con;
  383. }//
  384.  
  385.  
  386. function lsFacturas()
  387. {
  388. $SQL = "SELECT facturas.id_factura,facturas.folio AS folio_factura,contrarecibos.*,clientes.nombre,camiones.numero_camion ,
  389. (SELECT (SUM(viajes) * precio_unitario ) FROM detalle_contrarecibo
  390. WHERE id_contrarecibo = contrarecibos.id_contrarecibo) AS importe
  391. FROM contrarecibos
  392. INNER JOIN clientes ON contrarecibos.id_cliente=clientes.id_cliente
  393. INNER JOIN camiones ON contrarecibos.id_camion = camiones.id_camion
  394. INNER JOIN detalle_contrarecibo ON contrarecibos.id_contrarecibo = detalle_contrarecibo.id_contrarecibo
  395. INNER JOIN detalle_factura ON detalle_Factura.id_contrarecibo=contrarecibos.id_contrarecibo
  396. INNER JOIN facturas ON detalle_factura.id_factura=facturas.id_factura
  397. WHERE contrarecibos.id_contrarecibo IN (SELECT id_contrarecibo FROM detalle_factura)
  398. GROUP BY folio ORDER BY folio";
  399.  
  400. return $this->db->query($SQL);
  401.  
  402.  
  403. }
  404. function actualizarFolio($Datos)
  405. {
  406. $SQL="UPDATE facturas SET folio=".$Datos['txtfolio']." WHERE id_factura=".$Datos['id_factura']."";
  407. $resultado=$this->db->query($SQL);
  408. if($resultado->affectedRows()>0)
  409. {
  410. return true;
  411. }
  412. else
  413. {
  414. return false;
  415. }
  416. }
  417. function Guardar($Datos)
  418. {
  419.  
  420. $this->db->Transaccion();
  421. $this->db->transaccion->begin();
  422. $e=false;
  423. $SQL="INSERT INTO facturas SET
  424. folio='".$Datos['folio']."',
  425. fecha ='".$Datos['fecha']."',
  426. id_cliente='".$Datos['id_cliente']."',
  427. retencion=".$Datos['retencion']."
  428. ";
  429.  
  430.  
  431. //exit();
  432. $Resultado = $this->db->query($SQL);
  433. if($Resultado->affectedRows()>0)
  434. {
  435. $this->id_generado = $Resultado->insertID();
  436. $A=array();
  437. $A=array_chunk($Datos['Detallado'],5);
  438. $IdFactura =$Resultado->insertID();
  439. for( $i = 0 ; $i < count($A) ; $i++ )
  440. {
  441. $A[$i]['id_factura'] = $IdFactura;
  442.  
  443. if($this->guardarDetallado($A[$i]))
  444. {
  445. $e=true;
  446. }else
  447. {
  448. $e=false;
  449. break;
  450. }
  451. }//end for
  452.  
  453.  
  454. }//end size
  455.  
  456.  
  457.  
  458. if($e)
  459. $this->db->transaccion->commit();
  460. else
  461. $this->db->transaccion->rollback();
  462.  
  463. return $e;
  464.  
  465. }//
  466.  
  467.  
  468. function guardarDetallado($Datos)
  469. {
  470. $e=false;
  471. //print_r($Datos);
  472. $SQL="
  473. INSERT INTO detalle_factura SET
  474. id_factura = ".$Datos['id_factura'].",
  475. id_contrarecibo = ".$Datos[1];
  476.  
  477. $Resultado=$this->db->query($SQL);
  478.  
  479. if($Resultado->affectedRows()>0)
  480. $e=true;
  481. else
  482. $e=false;
  483.  
  484. return $e;
  485.  
  486. }//
  487.  
  488.  
  489.  
  490.  
  491. function generarFactura($IdFactura)
  492. {
  493.  
  494. $SQL="
  495. SELECT sum(viajes),capacidad,SUM(precio_unitario * viajes)
  496. FROM facturas
  497. INNER JOIN detalle_factura ON facturas.id_factura = detalle_factura.id_factura
  498. INNER JOIN detalle_contrarecibo ON detalle_contrarecibo.id_contrarecibo = detalle_factura.id_contrarecibo
  499. WHERE facturas.id_factura = $IdFactura
  500. GROUP BY viajes,capacidad
  501. ";
  502.  
  503.  
  504.  
  505. }//generarFactura
  506.  
  507. function verDatos($IdFactura)
  508. {
  509. $SQL="SELECT * FROM facturas INNER JOIN clientes ON facturas.id_cliente = clientes.id_cliente WHERE id_factura = $IdFactura";
  510. return $this->db->query($SQL);
  511. }//
  512.  
  513. function verDetalles($IdFactura)
  514. {
  515. $SQL="SELECT contrarecibos.*,capacidad,kilometros,SUM(viajes) AS viajes,SUM(precio_unitario*viajes) AS total,detalle_contrarecibo.precio_unitario
  516. FROM detalle_factura
  517. INNER JOIN contrarecibos ON detalle_factura.id_contrarecibo = contrarecibos.id_contrarecibo
  518. INNER JOIN detalle_contrarecibo ON contrarecibos.id_contrarecibo = detalle_contrarecibo.id_contrarecibo
  519. WHERE detalle_factura.id_factura = $IdFactura GROUP BY capacidad,kilometros";
  520.  
  521. return $this->db->query($SQL);
  522.  
  523. }//
  524.  
  525. function borrarFactura($Id_Factura)
  526. {
  527. $SQL="DELETE FROM detalle_factura WHERE id_factura=".$Id_Factura."";
  528. $Resultado=$this->db->query($SQL);
  529. if($Resultado->affectedRows()>0)
  530. {
  531. $SQL="DELETE FROM facturas WHERE id_factura=".$Id_Factura."";
  532. $Resultado=$this->db->query($SQL);
  533.  
  534. if($Resultado->affectedRows()>0)
  535. {
  536. return true;
  537. }
  538. else
  539. {
  540. return false;
  541. }
  542. }
  543. else
  544. {
  545. return false;
  546. }
  547. }//
  548.  
  549.  
  550.  
  551.  
  552.  
  553. }//end class
  554. ?>
  555.  
  556. <ul>
  557.  
  558. <?php
  559. //$pagina = $_SERVER['HTTP_REFERER'];
  560.  
  561. switch($_GET['seccion'])
  562. {
  563. case "clientes":
  564. ?>
  565. <li><a href="index.php?seccion=clientes&subseccion=regCliente">Registrar Cliente</a></li>
  566. <li><a href="index.php?seccion=clientes&subseccion=lsClientes">Listar Cliente</a></li>
  567. <li><a href="index.php?seccion=clientes&subseccion=reporteClienteId">Reporte por ID</a></li>
  568. <li><a href="index.php?seccion=clientes&subseccion=reporteCamionNombre">Reporte por Nombre </a></li>
  569. <li><a href="index.php?seccion=clientes&subseccion=reporteCamionCiudad">Reporte por Ciudad </a></li>
  570.  
  571. <?php
  572. break;
  573.  
  574. case "propietarios":
  575. ?>
  576. <li><a href="index.php?seccion=propietarios&subseccion=regPropietario">Registrar Propietario</a></li>
  577. <li><a href="index.php?seccion=propietarios&subseccion=lsPropietario">Listar Propietario</a></li>
  578. <li><a href="index.php?seccion=propietarios&subseccion=reportePropietarioId">Reporte por ID</a></li>
  579. <li><a href="index.php?seccion=propietarios&subseccion=reportePropietarioNombre">Reporte por Nombre</a></li>
  580. <li><a href="index.php?seccion=propietarios&subseccion=reportePropietarioRFC">Reporte por RFC</a></li>
  581.  
  582.  
  583. <?php
  584. break;
  585.  
  586. case "camiones":
  587. ?>
  588. <li><a href="index.php?seccion=camiones&subseccion=regCamion">Registrar Cami&oacute;n</a></li>
  589. <li><a href="index.php?seccion=camiones&subseccion=lsCamion">Listar Cami&oacute;n</a></li>
  590. <li><a href="index.php?seccion=camiones&subseccion=reporteCamionId">Reporte por ID</a></li>
  591. <li><a href="index.php?seccion=camiones&subseccion=reporteCamionProp">Reporte Por Propietario</a></li>
  592.  
  593. <?php
  594. break;
  595.  
  596.  
  597. case "factura":
  598. ?>
  599. <li><a href="index.php?seccion=facturas&subseccion=lsFacturas">Listar Facturas</a></li>
  600.  
  601. <?php
  602. break;
  603. case "precios":
  604. ?>
  605. <li><a href="index.php?seccion=precios&subseccion=lsprecios">Listar precios</a></li>
  606.  
  607. <?php
  608. break;
  609.  
  610. case "contrarecibos": ?>
  611. <li><a href="index.php?seccion=contrarecibos&subseccion=regContrarecibo">Registrar Contrarecibo</a></li>
  612. <li><a href="index.php?seccion=contrarecibos&subseccion=lsContrareciboNoFacturado">Contrarecibos Sin Facturar</a></li>
  613. <li><a href="index.php?seccion=contrarecibos&subseccion=lsContrareciboFacturado">Contrarecibos Facturados</a></li>
  614. <?php
  615. break;
  616. case "recibos":
  617. ?>
  618. <li><a href="index.php?seccion=recibos&subseccion=regRecibo">Registrar Recibo</a></li>
  619. <li><a href="index.php?seccion=recibos&subseccion=lsRecibo">Listar Recibos</a></li>
  620. <li><a href="index.php?seccion=recibos&subseccion=reporteRecibosId">Reporte por ID </a></li>
  621. <li><a href="index.php?seccion=recibos&subseccion=reporteRecibosProp">Reporte por Propietario</a></li>
  622. <li><a href="index.php?seccion=recibos&subseccion=reporteRecibosFecha">Reporte por Fecha</a></li>
  623. <li><a href="index.php?seccion=recibos&subseccion=imprimirRecibo">Imprimir Recibo</a></li>
  624. <?
  625. break;
  626. case "relaciones":
  627. ?>
  628. <li><a href="index.php?seccion=relaciones&subseccion=regRelacion">Registrar Relacion de Pagos</a></li>
  629. <li><a href="index.php?seccion=relaciones&subseccion=lsRelacion">Listado de Relaciones</a></li>
  630. <?
  631. }//end switch
  632.  
  633. ?>
  634. </ul>
  635. <?php
  636.  
  637. session_start();
  638. include ('../../connections/MySQL.php');
  639. include ('../../clases/classCliente.php');
  640. include ('../../utilerias/pdf/classPDF.php');
  641. //
  642. $db = &new MySQL();
  643. $cliente = new Cliente(&$db);
  644.  
  645. $pdf = new PDF();
  646.  
  647. $result = $cliente->Listar("SELECT * FROM clientes");
  648. $pdf->addPage();
  649. $pdf->SetFillColor(255,0,0);
  650. $pdf->SetTextColor(255);
  651. $pdf->SetDrawColor(128,0,0);
  652. $pdf->SetLineWidth(.3);
  653. $pdf->SetFont('Arial','','10');
  654. //Cabecera
  655. //Restauración de colores y fuentes
  656. $pdf->SetFillColor(224,235,255);
  657. $pdf->SetTextColor(0);
  658. $pdf->SetFont('');
  659. //Datos
  660. $fill=false;
  661. while($row=$result->fetch()){
  662. //$pdf->MultiCell(190,12,"",0,'C',$fill);
  663. //$pdf->Cell($w[0],6,$row['nombre'],'LR',0,'L',$fill);
  664.  
  665. $pdf->setFont('Arial', 'B', '14');
  666. $pdf->Cell(160,8,$row['nombre'],'B',0,'L',false);
  667. $pdf->setFont('Arial','','10');
  668. $pdf->Ln();
  669. $pdf->Cell(40,6,$row['razonsocial'],'0',0,'L',false);
  670. $pdf->Ln(4);
  671. $pdf->Cell(40,6,$row['rfc'],'0',0,'L',false);
  672. $pdf->Ln(4);
  673. $pdf->Cell(40,6,$row['domicilio'],'0',0,'L',false);
  674. $pdf->Ln(4);
  675. $pdf->Cell(40,6,$row['ciudad']. ", C.P. ". $row['cp'],'0',0,'L',false);
  676. $pdf->Ln(4);
  677. $pdf->Cell(40,6,"Telefono Oficina: ".$row['telefono'] . ", Correo: " . $row['correo'],'0',0,'L',false);
  678. $pdf->Ln(4);
  679. $pdf->Cell(40,6,"Telefono Particular: ".$row['telefono2']. ", Celular. ". $row['celular'],'0',0,'L',false);
  680. $pdf->Ln(4);
  681. $pdf->Ln(10);
  682.  
  683. }
  684. $pdf->Output();
  685.  
  686.  
  687.  
  688.  
  689.  
  690.  
  691. ?>
  692.  
  693. <?php
  694. if(isset($_POST['btnEnviar']) && $_SESSION['Time']!=$_POST['hdTime'])
  695. {
  696. $Datos = array();
  697. $Datos['nombre']=$_POST['txtNombre'];
  698. $Datos['apellidos'] = $_POST['txtApellidos'];
  699. $Datos['rfc'] = $_POST['txtRFC'];
  700. $Datos['domicilio'] = $_POST['txtDomicilio'];
  701. $Datos['ciudad'] = $_POST['txtCiudad'];
  702.  
  703. $resultado=$Cliente->registrarCliente($Datos);
  704. if($resultado)
  705. {
  706. ?>
  707. <script type="text/javascript">
  708. alert("Cliente registrado");
  709. </script>
  710. <?
  711. }
  712. else
  713. {
  714. ?>
  715. <script type="text/javascript">
  716. alert("Error al registrar...");
  717. </script>
  718. <?
  719. }
  720. }
  721.  
  722. ?>
  723. <form name="frmregistrocliente" method="post" action="<? $_SERVER['PHP_SELF'];?>">
  724. <fieldset><legend>Registrar Cliente</legend>
  725. <table class="datatable">
  726. <tr>
  727. <td>Nombre: </td>
  728. <td><input type="text" name="txtNombre" class="txt2" size="50"/></td>
  729. </tr>
  730. <tr>
  731. <td>Domicilio: </td>
  732. <td><input type="text" name="txtDomicilio" class="txt2" size="65" /></td>
  733. </tr>
  734. <tr>
  735. <td>Ciudad: </td>
  736. <td><input type="text" name="txtCiudad" class="txt2" size="40"/></td>
  737. </tr>
  738. <tr>
  739. <td>RFC: </td>
  740. <td><input type="text" name="txtRFC" class="txt2" /></td>
  741. </tr>
  742.  
  743. <tr>
  744. <td align="center" colspan="2">
  745. <input type="hidden" name="hdTime" value="<?=time();?>" />
  746. <input type="submit" name="btnEnviar" value="Registrar" />
  747. </td>
  748. </tr>
  749. </table>
  750.  
  751. </fieldset>
  752. </form>
  753. <h3>CAT&Aacute;LOGO DE CLIENTES</h3>
  754.  
  755. <table class="datatable" width="90%" align="center">
  756.  
  757. <tr>
  758. <th>Modificar</th>
  759. <th>Eliminar</th>
  760. <th>Id </th>
  761. <th>Nombre</th>
  762. <th>RFC</th>
  763. <th>Domicilio</th>
  764. <th>Ciudad</th>
  765. </tr>
  766. <?php
  767. $resultado=$Cliente->lsClientes();
  768. if($resultado->size()>0)
  769. {
  770. while($rec=$resultado->fetch())
  771. {
  772.  
  773. ?>
  774. <tr <?php if($i%2==1){?> class="altrow"<?php }$i++; ?>>
  775. <td align="center" width="10">
  776. <a href="index.php?seccion=clientes&subseccion=editarCliente&id=<?=$rec['id_cliente'];?>" ><img src="layout/imagenes/b_edit.png" alt="Editar" /></a>
  777. </td>
  778. <td align="center" width="10">
  779. <a href="index.php?seccion=clientes&subseccion=eliminarCliente&id=<?=$rec['id_cliente']?>"><img src="layout/imagenes/b_drop.png" alt="Eliminar" /></a>
  780. </td>
  781. <td><?=$rec['id_cliente'];?></td>
  782. <td><?=htmlentities($rec['nombre']);?></td>
  783. <td><?=htmlentities($rec['rfc']);?></td>
  784. <td><?=htmlentities($rec['domicilio']);?></td>
  785. <td><?=$rec['ciudad'];?></td>
  786. </tr>
  787. <?
  788. }//fin while
  789. }//fin size()
  790. ?>
  791. <tr bgcolor="#eaeaea">
  792. <td colspan="7" align="center">Fin del Reporte</td>
  793. </tr>
  794. </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement