D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
var
/
www
/
html
/
rosario
/
adm
/
vendor
/
api
/
Filename :
pega_trade_filial_disp.php
back
Copy
<?php /* define('HOST','localhost:3308'); define('USER', 'root'); define('PASS', ''); define('DBNAME', 'rosario'); */ //define('HOST', 'crsys.ml:3306'); define('HOST', '159.65.100.255'); define('USER', 'carlos'); define('PASS', 'Crm8751M@'); define('DBNAME', 'rosario'); $link = mysqli_connect(HOST, USER, PASS); if (!$link) { die('Não conseguiu conectar: ' . mysql_error()); } // seleciona o banco devcodes //foreach ($_POST as $param_name => $param_val) { // var_dump("Param:".$param_name. "Value: ".$param_val . "<br />\n"); //} $plano_pacote = 'N'; $tipo_id = $_POST['tipo_id']; $sub_tipo_id = $_POST['sub_tipo_id']; $acao_id = $_POST['acao_id']; if(isset($_POST['filial_controle'])) { $filial_controle = $_POST['filial_controle']; }else{ $filial_controle = 0; } $db_selected = mysqli_select_db( $link,DBNAME); if (!$db_selected) { die ('Não pode selecionar o banco '.DBNAME.' : ' . mysql_error()); } if($plano_pacote == 'N') { if($filial_controle == 0){ $query = "SELECT f.id, f.nome fil_disp_nome, m.nome muni_nome, 0 fil_disp_qtde FROM ro_filial f inner join ro_municipios m on m.id = f.ro_municipio_id WHERE f.situacao_id = 1 and f.id < 999"; // var_dump($query); $result = mysqli_query($link, $query) or die(mysqli_error()); $stringFil = ""; if($filial_controle == 0) { $stringFil = "<thead><tr><td class='ffff' align='center'><font color='blue'><b>Selecione Filial à Incluir Ação </b></font></td></tr></thead>"; }else{ $stringFil = "<thead><tr><td align='center'><b>Clique em Filial à Excluir</b></td></tr></thead>"; } //$stringFil = "<tr><th>Descrição</th><th>tipo</th><th>subtipo</th><th>Disponível</th><th>Qtde Contrato</th></tr>"; // $stringFil .= "<tbody class='tbodyfilial'>"; while ($row = mysqli_fetch_array($result)) { if($plano_pacote == 'S') { // $stringFil .= "<tr><td>" . $row[1] . "</td><td>" . $row[2] . "</td><td>" . $row[3] . "</td><td>" . $row[7] . "</td><td align='center'> <input type='number' max='" . $row[7] . "' min='" . 0 . "' name='gravar_lojas[" .$row[0] . "]'". "></td></td></tr>"; $stringFil .= "<tr><td>" . $row[1].' - '.$row[2] . "</td><td align='center'> <input type='checkbox' id='gravar_lojas' name='gravar_lojas[" .$row[0] . "]'". " checked></td></tr>"; }else{ // $stringFil .= "<tr><td>" . $row[1].' - '.$row[2] . "</td><td align='center'> <input class='editar' type='checkbox' id='gravar_lojas' name='gravar_lojas[" .$row[0] . "]'". " ></td></td></tr>"; $stringFil .= "<tr><td class='fff'>" . $row[1].' - '.$row[2] . "</td><td align='center' class='ff' > <input class='editar' type='checkbox' id='gravar_lojas' name='" .$row[0] . "'" . "></td></tr>"; } // $stringFil .= "<tr><td>" . $row[1] . "</td><td>" . $row[2] . "</td><td>" . $row[3] . "</td><td>" . $row[7] . "</td><td align='center'> <input type='number' max='" . $row[7] . "' min='" . 0 . "' name='gravar_lojas[" .$row[0] . "]'". "></td></td></tr>"; //$stringAux .= "<tr><td>" . $row[0] . "</td><td>" . $row[1] . "</tr>"; } //$stringFil .= "</tbody>"; echo $stringFil; } }else{ $query = "SELECT f.id, f.nome fil_disp_nome, m.nome muni_nome, 0 fil_disp_qtde FROM ro_filial f inner join ro_municipios m on m.id = f.ro_municipio_id WHERE f.situacao_id = 1 and f.id < 999"; $result = mysqli_query($link, $query) or die(mysqli_error()); $stringFil = ""; $stringFil = "<thead><tr><td align='center'><font color='blue'><b>Clique em Filial à Excluir</b></font></td></tr></thead>"; while ($row = mysqli_fetch_array($result)) { $stringFil .= "<tr><td>" . $row[1].' - '.$row[2] . "</td><td align='center'> <input type='checkbox' name='gravar_lojas[" .$row[0] . "]'". " checked></td></td></tr>"; //$stringAux .= "<tr><td>" . $row[0] . "</td><td>" . $row[1] . "</tr>"; } echo $stringFil; } ?>