Advertisement
MostafaCss

Untitled

Sep 10th, 2019
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.43 KB | None | 0 0
  1. <?php
  2. session_start();
  3. include_once("../../DataBase/Connection.php");
  4. include_once("../../Php/Assistant.php");
  5. include_once("../../Php/Smart.php");
  6. include_once("../../Php/Date.php");
  7.  
  8.     $Sql = "INSERT INTO `infoproduct` (name) VALUES ('".$Security->cleanMe($_POST["Name"])."')";
  9.     $Rows = $DataBase->query($Sql);
  10.     //$Smart->Insert("infoproduct", array("name", "family", "tell", "mobile", "fax", "emails", "website", "address_showroom", "address_factory", "categori", "add_date", "name_product", "price", "metrazh", "code_product", "description", "name_factory"), array($Security->cleanMe($_POST["Name"]), $Security->cleanMe($_POST["Family"]), $Security->cleanMe($_POST["Tell"]), $Security->cleanMe($_POST["Mobile"]), $Security->cleanMe($_POST["Fax"]), $Security->cleanMe($_POST["Email"]), $Security->cleanMe($_POST["Url"]), $Security->cleanMe($_POST["AddressShowRoom"]), $Security->cleanMe($_POST["AddressFactory"]), $Security->cleanMe($_POST["Categori"]), $date_block, $Security->cleanMe($_POST["NameProduct"]), $Security->cleanMe($_POST["Price"]), $Security->cleanMe($_POST["Metrazh"]), $Security->cleanMe($_POST["Code"]), $Security->cleanMe($_POST["Description"]), $Security->cleanMe($_POST["Factory"])), "1", "../infoproduct.php");
  11.     $Sql = "SELECT * FROM `infoproduct` ORDER BY `id` DESC";
  12.     $Rows = $DataBase->query($Sql);
  13.     $NumRows = 0;
  14.     $HeaderTitle = '<table>
  15.            <tr>
  16.                <th width="30"><label>ردیف</label></th>
  17.                <th width="100"><label>نام, فامیل</label></th>
  18.                <th width="120"><label>تلفن, موبایل, فکس</label></th>
  19.                <th width="150"><label>ایمیل, سایت, نام کارگاه</label></th>
  20.                <th width="230"><label>آدرس نمایشکاه, آدرس کارگاه</label></th>
  21.                <th width="100"><label>دسته بندی, تاریخ</label></th>
  22.                <th width="120"><label>نام محصول, قیمت,متراژ</label></th>
  23.                <th></th>
  24.            </tr>';
  25.     print_r($HeaderTitle);
  26.     foreach($Rows->fetchAll(PDO::FETCH_OBJ) as $Result)
  27.     {
  28.         $NumRows++;
  29.         $Table = '<tr>
  30.                <td style="text-align: center;"><label>'.$NumRows.'</label></td>
  31.                <td>
  32.                    <input type="text" id="Name" style="margin-bottom: 5px;" value="'.$Result->name.'">
  33.                    <input type="text" id="Family" style="margin-bottom: 5px;" value="'.$Result->family.'">
  34.                </td>
  35.                <td>
  36.                    <input type="text" id="Tell" style="margin-bottom: 5px;" value="'.$Result->tell.'">
  37.                    <input type="text" id="Mobile" style="margin-bottom: 5px;" value="'.$Result->mobile.'">
  38.                    <input type="text" id="Fax" value="'.$Result->fax.'">
  39.                </td>
  40.                <td>
  41.                    <input type="text" id="Email" style="margin-bottom: 5px;width: 140px;" value="'.$Result->emails.'">
  42.                    <input type="text" id="Url" style="margin-bottom: 5px;width: 140px;" value="'.$Result->website.'">
  43.                    <input type="text" id="NameFactory" style="width: 140px;" value="'.$Result->name_factory.'">
  44.                </td>
  45.                <td>
  46.                    <input type="text" id="AddressShowRoom" style="margin-bottom: 5px;width: 220px;" value="'.$Result->address_showroom.'">
  47.                    <input type="text" id="AddressFactory" style="width: 220px;" value="'.$Result->address_factory.'">
  48.                </td>
  49.                <td style="text-align: center;">
  50.                    <input type="text" id="Categori" style="margin-bottom: 5px;" value="'.$Result->categori.'">
  51.                    <input type="text" id="Code" style="margin-bottom: 5px;" value="'.$Result->code_product.'">
  52.                    <label>'.$Result->add_date.'</label>
  53.                </td>
  54.                <td>
  55.                    <input type="text" id="Email" style="margin-bottom: 5px;" value="'.$Result->name_product.'">
  56.                    <input type="text" id="Url" style="margin-bottom: 5px;" value="'.$Result->price.'">
  57.                    <input type="text" id="NameFactory" value="'.$Result->metrazh.'">
  58.                </td>
  59.                <td><p class = "M" onclick="Test('.$Result->id.')">'.$Result->id.'</p></td>
  60.            </tr>
  61.            <tr><td colspan="8"></td></tr>
  62.            ';
  63.         print_r($Table);
  64.     }
  65.     $Table = NULL;
  66.     print_r("</table>");
  67. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement