<p>Clientes</p> </div> <div class="icon"> <i class="ion ion-stats-bars"></i> </div> <a href="./?view=clients" class="small-box-footer">Ver mas <i class="fa fa-arrow-circle-right"></i></a> </div> </div> <!-- ./col --> <div class="col-lg-3 col-xs-6"> <!-- small box --> <div class="small-box bg-yellow"> <div class="inner"> <h3><?php echo count(PersonData::getProviders()); ?> </h3> <p>Proveedores</p> </div> <div class="icon"> <i class="ion ion-person-add"></i> </div> <a href="./?view=providers" class="small-box-footer">Ver mas <i class="fa fa-arrow-circle-right"></i></a> </div> </div> <!-- ./col --> <div class="col-lg-3 col-xs-6"> <!-- small box --> <div class="small-box bg-red">
<?php include "../core/autoload.php"; include "../core/modules/index/model/PersonData.php"; require_once '../PhpWord/Autoloader.php'; use PhpOffice\PhpWord\Autoloader; use PhpOffice\PhpWord\Settings; Autoloader::register(); $word = new PhpOffice\PhpWord\PhpWord(); $clients = PersonData::getProviders(); $section1 = $word->AddSection(); $section1->addText("PROVEEDORES", array("size" => 22, "bold" => true, "align" => "right")); $styleTable = array('borderSize' => 6, 'borderColor' => '888888', 'cellMargin' => 40); $styleFirstRow = array('borderBottomColor' => '0000FF', 'bgColor' => 'AAAAAA'); $table1 = $section1->addTable("table1"); $table1->addRow(); $table1->addCell()->addText("Nombre"); $table1->addCell()->addText("Direccion"); $table1->addCell()->addText("Email"); $table1->addCell()->addText("Telefono"); foreach ($clients as $client) { $table1->addRow(); $table1->addCell(5000)->addText($client->name . " " . $client->lastname); $table1->addCell(2500)->addText($client->address1); $table1->addCell(2000)->addText($client->email1); $table1->addCell(2000)->addText($client->phone1); } $word->addTableStyle('table1', $styleTable, $styleFirstRow); /// datos bancarios $filename = "providers-" . time() . ".docx"; #$word->setReadDataOnly(true);
<div class="col-md-12"> <div class="btn-group pull-right"> <a href="index.php?view=newprovider" class="btn btn-default"><i class='fa fa-truck'></i> Nuevo Proveedor</a> <div class="btn-group pull-right"> <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"> <i class="fa fa-download"></i> Descargar <span class="caret"></span> </button> <ul class="dropdown-menu" role="menu"> <li><a href="report/providers-word.php">Word 2007 (.docx)</a></li> </ul> </div> </div> <h1>Directorio de Proveedores</h1> <br> <?php $users = PersonData::getProviders(); if (count($users) > 0) { // si hay usuarios ?> <table class="table table-bordered table-hover"> <thead> <th>Nombre completo</th> <th>Direccion</th> <th>Email</th> <th>Telefono</th> <th></th> </thead> <?php foreach ($users as $user) { ?>