Exemplo n.º 1
0
<?php

$client = ClientData::getById($_GET["client_id"]);
?>
        <!-- Main Content -->

          <div class="row">
            <div class="col-md-12">
  <!-- Button trigger modal -->


            <h2>EDITAR CLIENTE</h2>
            </div>
            </div>

          <div class="row">
            <div class="col-md-12">
              <div class="panel panel-default">
                <div class="panel-heading">
                  <i class="fa fa-ticket"></i> Editar Cliente
                </div>
                <div class="panel-body ">
<form class="form-horizontal" role="form" method="post" action="index.php?action=updateclient">
  <div class="form-group">
    <label for="inputEmail1" class="col-lg-2 control-label">Nombre</label>
    <div class="col-lg-10">
      <input type="text" name="name" required value="<?php 
echo $client->name;
?>
" class="form-control" id="inputEmail1" placeholder="Nombre">
    </div>
Exemplo n.º 2
0
<?php 
$buy = BuyData::getById($_GET["buy_id"]);
$products = BuyProductData::getAllByBuyId($_GET["buy_id"]);
$client = ClientData::getById($buy->client_id);
$paymethod = $buy->getPaymethod();
$iva = ConfigurationData::getByPreffix("general_iva")->val;
$coin = ConfigurationData::getByPreffix("general_coin")->val;
$ivatxt = ConfigurationData::getByPreffix("general_iva_txt")->val;
?>
<div class="row">
	<div class="col-md-12">
	<h2> Compra #<?php 
echo $buy->id;
?>
 [<?php 
echo $buy->getStatus()->name;
?>
]</h2>
	<h4>Cliente: <?php 
echo $client->getFullname();
?>
</h4>
	<h4>Metodo de pago : <?php 
echo $paymethod->name;
?>
</h4>
<?php 
if (count($products) > 0) {
    ?>
<table class="table table-bordered">
Exemplo n.º 3
0
<?php

if (isset($_SESSION["client_id"])) {
    $client = ClientData::getById($_SESSION["client_id"]);
    ?>
<div class="container">
<div class="row">

<div class="col-md-12">
<h3>Bienvenido, <?php 
    echo $client->name . " " . $client->lastname;
    ?>
</h3>
</div>

</div>
</div>
<?php 
    $buys = BuyData::getAllByClientid($_SESSION["client_id"]);
    ?>
<div class="container">
<div class="row">
	<div class="col-md-12">
	<h2>Mis Compras</h2>
<?php 
    if (count($buys) > 0) {
        ?>
<table class="table table-bordered">
	<thead>
		<th></th>
		<th>Compra</th>
Exemplo n.º 4
0
<?php

if (count($_POST) > 0) {
    $user = ClientData::getById($_POST["id"]);
    $user->name = $_POST["name"];
    $user->lastname = $_POST["lastname"];
    $user->address = $_POST["address"];
    $user->email = $_POST["email"];
    $user->phone = $_POST["phone"];
    $user->update();
    Core::alert("Actualizado exitosamente!");
    print "<script>window.location='index.php?view=clients';</script>";
}
Exemplo n.º 5
0
<?php

if (!empty($_POST)) {
    $client = ClientData::getById($_POST["id"]);
    $client->name = $_POST["name"];
    $client->lastname = $_POST["lastname"];
    $client->email = $_POST["email"];
    $client->address = $_POST["address"];
    $client->phone = $_POST["phone"];
    $client->update();
    if ($_POST["password"] != "") {
        @($client->password = crypt($_POST["password"]));
        $client->update_passwd();
    }
    Core::redir("./?view=clients");
}
Exemplo n.º 6
0
 public function getClient()
 {
     return ClientData::getById($this->client_id);
 }
Exemplo n.º 7
0
 function ImprovedTable($data)
 {
     $iva = ConfigurationData::getByPreffix("general_iva")->val;
     $iva_txt = ConfigurationData::getByPreffix("general_iva_txt")->val;
     $coin = ConfigurationData::getByPreffix("general_coin")->val;
     $service = BuyData::getByCode($_GET["code"]);
     $products = BuyProductData::getAllByBuyId($service->id);
     $client = ClientData::getById($service->client_id);
     $this->setY(31);
     $this->setX(20);
     $this->setY(31);
     $this->setX(20);
     $this->SetFont('Arial', 'B', 8);
     $this->setY(33);
     $this->setX(20);
     $this->setY(40);
     $this->setX(20);
     $this->SetFont('Arial', 'B', 8);
     //         $this->Cell(0,35,"",1);
     $this->setY(38);
     $this->setX(20);
     $this->Cell(0, 10, " NOMBRE:        " . $client->getFullname());
     $this->setY(43);
     $this->setX(20);
     $this->Cell(0, 10, " DIRECCION:        " . $client->address);
     $this->setY(48);
     $this->setX(20);
     $this->Cell(0, 10, "TEL:      " . $client->phone);
     $this->setY(53);
     $this->setX(20);
     $this->setY(80);
     $this->setX(20);
     $this->SetFont('Arial', '', 14);
     $this->Cell(0, 10, " DETALLES DE LA COMPRA ");
     $this->SetFont('Arial', 'B', 10);
     $starty = 0;
     $total = 0;
     //    $inventary_item = InventaryData::getAllBySII($service->id,$ii->id);
     $this->setY(95 + $starty);
     $this->setX(20);
     //// omito el super trabajo
     ///         $this->Cell(0,10,strtoupper($w->getWork()->name));
     $this->setY(95 + $starty);
     $this->setX(65);
     //         $starty+=5;
     //////////////////////// materiales
     if (count($products)) {
         $starty += 5;
         foreach ($products as $itemx) {
             $item = $itemx->getProduct();
             $mtx = null;
             $this->setY(95 + $starty);
             $this->setX(20);
             $this->Cell(0, 10, strtoupper($itemx->q));
             $this->setX(30);
             $this->Cell(0, 10, strtoupper($item->getUnit()->name));
             $this->setX(50);
             $this->Cell(0, 10, strtoupper($item->name));
             $this->setX(180);
             $this->Cell(0, 10, utf8_decode($coin) . " " . number_format($item->price, 2, ".", ","));
             $total += $itemx->q * $item->price;
             $this->setY(95 + $starty);
             $this->setX(65);
             $starty += 5;
         }
     }
     $starty += 5;
     ///////////////////////////////////////////////////////////// Total
     $this->SetFont('Arial', '', 12);
     $this->setY(125 + $starty);
     $this->setX(20);
     $this->Cell(0, 10, "SubTotal:          " . utf8_decode($coin) . " " . number_format($total * (1 - $iva / 100), 2, ".", ","));
     $starty += 5;
     $this->setY(125 + $starty);
     $this->setX(20);
     $this->Cell(0, 10, "{$iva_txt}:                   " . utf8_decode($coin) . " " . number_format($total * ($iva / 100), 2, ".", ","));
     $starty += 5;
     $this->setY(125 + $starty);
     $this->setX(20);
     $this->Cell(0, 10, "Total:                 " . utf8_decode($coin) . " " . number_format($total, 2, ".", ","));
     /////////////////////////////////////////////////////////////
     ////////////////////////////////////////////////////
 }
Exemplo n.º 8
0
 function ImprovedTable($data)
 {
     $service = BuyData::getByCode($_GET["code"]);
     $products = BuyProductData::getAllByBuyId($service->id);
     $client = ClientData::getById($service->client_id);
     $this->setY(31);
     $this->setX(20);
     $this->setY(31);
     $this->setX(20);
     $this->SetFont('Arial', 'B', 8);
     $this->setY(33);
     $this->setX(20);
     $this->setY(40);
     $this->setX(20);
     $this->SetFont('Arial', 'B', 8);
     //         $this->Cell(0,35,"",1);
     $this->setY(38);
     $this->setX(20);
     $this->Cell(0, 10, " NOMBRE:        " . $client->name);
     $this->setY(43);
     $this->setX(20);
     $this->Cell(0, 10, " DIRECCION:        " . $client->address);
     $this->setY(48);
     $this->setX(20);
     $this->Cell(0, 10, "TEL:      " . $client->phone);
     $this->setY(53);
     $this->setX(20);
     $this->setY(80);
     $this->setX(20);
     $this->SetFont('Arial', '', 14);
     $this->Cell(0, 10, " DETALLES DE LA COMPRA ");
     $this->SetFont('Arial', 'B', 10);
     $starty = 0;
     $total = 0;
     //    $inventary_item = InventaryData::getAllBySII($service->id,$ii->id);
     $this->setY(95 + $starty);
     $this->setX(20);
     //// omito el super trabajo
     ///         $this->Cell(0,10,strtoupper($w->getWork()->name));
     $this->setY(95 + $starty);
     $this->setX(65);
     //         $starty+=5;
     //////////////////////// materiales
     if (count($products)) {
         $starty += 5;
         foreach ($products as $itemx) {
             $item = $itemx->getProduct();
             $mtx = null;
             $this->setY(95 + $starty);
             $this->setX(20);
             $this->Cell(0, 10, strtoupper($itemx->q));
             $this->setX(30);
             $this->Cell(0, 10, strtoupper($item->getUnit()->name));
             $this->setX(50);
             $this->Cell(0, 10, strtoupper($item->name));
             $this->setX(180);
             $this->Cell(0, 10, "\$ " . number_format($item->price, 2, ".", ","));
             $total += $itemx->q * $item->price;
             $this->setY(95 + $starty);
             $this->setX(65);
             $starty += 5;
         }
     }
     ////////////////////////
     //////////////////////// materiales
     /*if(count($subworks)){
              $this->setX(20);
              $this->Cell(0,(count($subworks)*5)+10,"",1);
              $this->setY(95+$starty);
              $this->setX(20);
              $this->Cell(0,10,strtoupper("**MATERIALES"));
              $starty+=5;
         foreach($subworks as $item){
             $mtx=null;
             foreach($mts as $mt){ if($mt->material_id==$item->id){ $mtx = $mt; }}
             if($mtx!=null&& $mtx->material_id==$item->id){
                 
              $this->setY(95+$starty);
              $this->setX(20);
              $this->Cell(0,10,strtoupper($item->name));
              $this->setX(180);
              $this->Cell(0,10,"$ ".number_format($item->price,2,".",","));
              $this->setY(95+$starty);
              $this->setX(65);
              $starty+=5;
     
             }
     
         }
     }
     */
     ////////////////////////
     //         $this->Cell(0,10,"|X|__| ");
     //         $this->Cell(0,10,"|__|X| ");
     $starty += 5;
     ///////////////////////////////////////////////////////////// Total
     $this->SetFont('Arial', '', 12);
     $this->setY(125 + $starty);
     $this->setX(20);
     $this->Cell(0, 10, "SubTotal:          \$ " . number_format($total * 0.84, 2, ".", ","));
     $starty += 5;
     $this->setY(125 + $starty);
     $this->setX(20);
     $this->Cell(0, 10, "IVA:                   \$ " . number_format($total * 0.16, 2, ".", ","));
     $starty += 5;
     $this->setY(125 + $starty);
     $this->setX(20);
     $this->Cell(0, 10, "Total:                 \$ " . number_format($total, 2, ".", ","));
     /////////////////////////////////////////////////////////////
     ////////////////////////////////////////////////////
 }