?> <?php find_selected_page(); ?> <?php $agency_set = find_all_agencies(); ?> <?php $head_of_account_set = find_all_head_of_accounts(); ?> <?php $client_set = find_all_clients(); ?> <?php if (isset($_POST['submit'])) { // Process the form // Validations $required_fields = array("nij_ts_code", "name_of_work", "agency", "agency_address", "head_of_account", "client"); validate_presences($required_fields); $fields_with_max_lengths = array("efc_scheme_no" => 60, "requisition_no" => 60, "agreement_no" => 60, "subwork_no" => 60, "vide_letter_no" => 60, "aa_es_no" => 60, "aa_es_date" => 60, "aa_es_amount" => 60, "ts_no" => 60, "ts_date" => 60, "ts_amount" => 60, "ts_authority" => 60, "pe_no" => 60, "pe_date" => 60, "pe_amount_draft" => 60, "pe_sent_to" => 60, "final_pe_sent_to_client" => 60, "pe_amount_final" => 60, "pe_final_date" => 60, "nit_no" => 60, "nit_date" => 60, "nit_amount" => 60, "nit_time_in_months" => 60, "nij_ts_code" => 60, "name_of_work" => 500, "agency" => 60, "agency_address" => 60, "client" => 60, "head_of_account" => 60, "tendered_amount" => 60, "no_of_packages" => 60, "wb_pms_id" => 60, "date_of_start" => 60, "stipulated_date_of_completion" => 60, "actual_date_of_completion" => 60); validate_max_lengths($fields_with_max_lengths); if (empty($errors)) { // Perform Create $efc_scheme_no = mysql_prep($_POST["efc_scheme_no"]); $requisition_no = mysql_prep($_POST["requisition_no"]); $agreement_no = mysql_prep($_POST["agreement_no"]);
function output_all_client($query_recherche = false, $pseudo = null, $liste_restrictive = null, $web_view = null, $last_name = null, $first_name = null, $address = null, $liste_rank = null) { if ($query_recherche == true) { $client_set = find_client_query($pseudo, $liste_restrictive, $web_view, $last_name, $first_name, $address, $liste_rank); } else { $client_set = find_all_clients(); } $output = ""; // $style5px="style=\"text-align: center; width: 5px;\""; // $style10px="style=\"text-align: center; width: 10px;\""; // $style30px="style=\"text-align: center; width: 30px;\""; // // $style60px="style=\"text-align: center; width: 60px;\""; // $style70px="style=\"text-align: center; width: 70px;\""; // $style100px="style=\"text-align: center; width: 100px;\""; // $style160px="style=\"text-align: center; width: 160px;\""; $style5px = ""; $style10px = ""; $style30px = ""; // $style60px="style=\"text-align: center; width: 60px;\""; $style60px = ""; $style70px = ""; $style100px = ""; // $output= "<div class=\"CSSTableGenerator\">"; $output .= "<div class='table-responsive'>"; // $output .= "<table>"; $output .= "<table class='table table-striped table-bordered table-hover table-condensed'>"; $output .= "<tr>"; // $output .= "<th colspan=\"2\" style=\"text-align: center;width: 5px\">Actions</th>"; $output .= "<th class='text-center' colspan='2'>Actions</th>"; $output .= "<th class='text-center' {$style30px}>Restrict</th>"; $output .= "<th class='text-center' {$style10px}>Id</th>"; $output .= "<th class='text-center' {$style30px}>pseudo</th>"; $output .= "<th class='text-center' {$style30px}>web_view</th>"; $output .= "<th class='text-center' {$style70px}>Nom</th>"; $output .= "<th class='text-center' {$style30px}>Prénom</th>"; $output .= "<th class='text-center hide-columns' {$style60px}>addresse</th>"; $output .= "<th class='text-center hide-columns' {$style30px}>CP</th>"; $output .= "<th class='text-center hide-columns' {$style30px}>Ville</th>"; $output .= "<th class='text-center hide-columns' {$style30px}>Pays</th>"; $output .= "<th class='text-center' {$style30px}>Prix</th>"; $output .= "<th class='text-center' {$style30px}>Départ</th>"; $output .= "<th class='text-center' {$style30px}>Arrivée</th>"; $output .= "<th class='text-center' {$style30px}>Rank</th>"; $output .= "</tr>"; while ($clients = mysqli_fetch_assoc($client_set)) { //----------------restrict-------------------- $restrict = $clients["liste_restrictive"]; if ($restrict == 1) { $output .= "<tr class='success hide-success'>"; } else { $output .= "<tr class='hide-others'>"; } $output .= "<td style='width: 5px;'><a href=\"edit_client.php?id="; $output .= urlencode($clients["id"]); $output .= "\">"; // $output .="Edit"; $output .= "<span class='glyphicon glyphicon-pencil'style='color:blue;' aria-hidden='true'></span>"; $output .= "</a></td>"; $output .= "<td style='width: 5px;'><a href=\"delete_client.php?id="; $output .= urlencode($clients["id"]); $output .= "\" onclick=\"return confirm('Are you sure to delete?');"; $output .= "\">"; // $output .="Delete"; $output .= "<span class='glyphicon glyphicon-remove'style='color:red;' aria-hidden='true'></span>"; $output .= "</a></td>"; if ($restrict == 1) { $output .= "<td><a href=\"edit_client_list_restrict.php?id="; } else { $output .= "<td ><a href=\"edit_client_list_restrict.php?id="; } // $output .="<td style='width: 5px;'><a href=\"edit_client_list_restrict.php?id="; $output .= urlencode($clients["id"]); $output .= "\" onclick=\"return confirm('Are you sure to change restrict?');"; //TODO take val list restrict put words oui 1 non 0 if ($restrict == 1) { $output .= "\">"; // $output .="Oui"; $output .= "<span class='glyphicon glyphicon-ok' style='color:green;' aria-hidden='true'></span>"; $output .= "</a></td>"; } else { $output .= "\">"; $output .= "Non"; $output .= "</a></td>"; } //---------------end Restrict------------------------ // $output .="<td>". htmlentities($clients["liste_restrictive"], ENT_COMPAT, 'utf-8')."</td>"; $output .= "<td>" . htmlentities($clients["id"], ENT_COMPAT, 'utf-8') . "</td>"; $output .= "<td>" . htmlentities($clients["pseudo"], ENT_COMPAT, 'utf-8') . "</td>"; $output .= "<td>" . htmlentities($clients["web_view"], ENT_COMPAT, 'utf-8') . "</td>"; $output .= "<td>" . htmlentities($clients["last_name"], ENT_COMPAT, 'utf-8') . "</td>"; $output .= "<td>" . htmlentities($clients["first_name"], ENT_COMPAT, 'utf-8') . "</td>"; $output .= "<td class='hide-columns'>" . htmlentities($clients["address"], ENT_COMPAT, 'utf-8') . "</td>"; $output .= "<td class='hide-columns'>" . htmlentities($clients["cp"], ENT_COMPAT, 'utf-8') . "</td>"; $output .= "<td class='hide-columns'>" . htmlentities($clients["city"], ENT_COMPAT, 'utf-8') . "</td>"; $output .= "<td class='hide-columns'>" . htmlentities($clients["country"], ENT_COMPAT, 'utf-8') . "</td>"; $output .= "<td>" . htmlentities($clients["default_price"], ENT_COMPAT, 'utf-8') . "</td>"; $output .= "<td>" . htmlentities($clients["default_aller"], ENT_COMPAT, 'utf-8') . "</td>"; $output .= "<td>" . htmlentities($clients["default_arrivee"], ENT_COMPAT, 'utf-8') . "</td>"; $output .= "<td>" . htmlentities($clients["liste_rank"], ENT_COMPAT, 'utf-8') . "</td>"; $output .= "</tr>"; } $output .= "</table>"; mysqli_free_result($client_set); $output .= "</div>"; return $output; }