Server IP : 127.0.0.2 / Your IP : 18.216.95.250 Web Server : Apache/2.4.18 (Ubuntu) System : User : www-data ( ) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : disk_free_space,disk_total_space,diskfreespace,dl,exec,fpaththru,getmyuid,getmypid,highlight_file,ignore_user_abord,leak,listen,link,opcache_get_configuration,opcache_get_status,passthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,php_uname,phpinfo,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix,_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_times,posix_ttyname,posix_uname,pclose,popen,proc_open,proc_close,proc_get_status,proc_nice,proc_terminate,shell_exec,source,show_source,system,virtual MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/admin/ |
Upload File : |
<?php ob_start(); session_start(); require_once('session-check.php'); require_once('include/db-config.php'); ?> <?php $r = ""; $countryid = 0; if(isset($_POST['countryid'])) $countryid = $_POST['countryid']; $requestfrom = ""; if(isset($_POST['requestfrom'])) $requestfrom = $_POST['requestfrom']; if($requestfrom == "PriceForm") { $UpdatedDate = date("Y-m-d"); $CountryID = $_POST['CID']; $countryid = $CountryID; $i = 1; $sql ="delete from maintrainer_shippingdetails where CountryID = ".$countryid; $result =mysqli_query($conn,$sql); while($i <= 10) { //echo "<br>".$i; switch ($i) { case 1: $qtyfrom = $_POST['qtyfrom1']; $qtyto = $_POST['qtyto1']; $ShippingPrice = $_POST['ShippingPrice1']; break; case 2: $qtyfrom = $_POST['qtyfrom2']; $qtyto = $_POST['qtyto2']; $ShippingPrice = $_POST['ShippingPrice2']; break; case 3: $qtyfrom = $_POST['qtyfrom3']; $qtyto = $_POST['qtyto3']; $ShippingPrice = $_POST['ShippingPrice3']; break; case 4: $qtyfrom = $_POST['qtyfrom4']; $qtyto = $_POST['qtyto4']; $ShippingPrice= $_POST['ShippingPrice4']; break; case 5: $qtyfrom = $_POST['qtyfrom5']; $qtyto = $_POST['qtyto5']; $ShippingPrice= $_POST['ShippingPrice5']; break; case 6: $qtyfrom = $_POST['qtyfrom6']; $qtyto = $_POST['qtyto6']; $ShippingPrice = $_POST['ShippingPrice6']; break; case 7: $qtyfrom = $_POST['qtyfrom7']; $qtyto = $_POST['qtyto7']; $ShippingPrice= $_POST['ShippingPrice7']; break; case 8: $qtyfrom = $_POST['qtyfrom8']; $qtyto = $_POST['qtyto8']; $ShippingPrice= $_POST['ShippingPrice8']; break; case 9: $qtyfrom = $_POST['qtyfrom9']; $qtyto = $_POST['qtyto9']; $ShippingPrice= $_POST['ShippingPrice9']; break; case 10: $qtyfrom = $_POST['qtyfrom10']; $qtyto = $_POST['qtyto10']; $ShippingPrice= $_POST['ShippingPrice10']; break; default: $qtyfrom = ""; $qtyto = ""; $ShippingPrice= ""; break; } //echo "<br>".$qtyfrom. " ".$qtyto." ".$shippingprice; if($qtyfrom != "" and $qtyto != "" and $ShippingPrice!= "") { $sql = "Insert into maintrainer_shippingdetails(CountryID, QtyFrom, QtyTo, ShippingPrice) values(".$countryid.", ".$qtyfrom.", ".$qtyto.", ".$ShippingPrice." )"; $result =mysqli_query($conn,$sql); } $i = $i + 1; } $r = "1"; } $countryname=""; if(isset($_POST['newcountry'])) $countryname=$_POST['newcountry']; if($countryname!="") { $sql="insert into maintrainer_countrydetails (CountryName) values ('".$countryname."')"; $result =mysqli_query($conn,$sql); } ?> <!DOCTYPE html> <HTML> <HEAD> <TITLE>Joel Levitt, maintenance management, maintenance management consulting, tpms</TITLE> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> <link href="css/style.css" type="text/css" rel="stylesheet"> <style type="text/css"> .table { color: #FFFFFF; font-family: Arial, Verdana; } .normal { background-color: #323232; } .normalActive { background-color:#000000; } </style> </HEAD> <BODY BGCOLOR=#FFFFFF LEFTMARGIN="0" TOPMARGIN="0" MARGINWIDTH="0" MARGINHEIGHT="0"> <!-- ImageReady Slices (maintrainer_slice2.jpg) --> <TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" align="center"> <?php include_once('include/include_header.php'); ?> <TR> <TD valign="top" height="98%"> <table border="0" cellpadding="0" cellspacing="0" width="95%" align="center" class="body_bg"> <tr> <td style="height:9px;"></td> </tr> <tr> <td style="height:40px;" class="content_bg"> <?php if($r == '1') { echo "<font class='success-text'>You have successfully updated</font>"; } ?> </td> </tr> <tr> <td class="content_bg"> <form method="post" name="productchange" id="productchange" action="shipping-mgmt.php" onSubmit="return validateform();" > <input type="hidden" name="requestfrom" id="requestfrom" value="SelectDropdown"> <table border="0" cellpadding="0" cellspacing="0"> <tr> <td nowrap valign="middle" class="normal_text" style="padding-left:10px;"> Select Country </td> <td valign="middle" class="normal_text"> <select name="countryid" id="countryid" style="min-width:200px;" onChange="javascript: this.form.submit();" > <option></option> <?php $sql="select ID,CountryName from maintrainer_countrydetails"; $result =mysqli_query($conn,$sql); while($row = mysqli_fetch_array($result)) { $ID = $row['ID']; $CountryName = $row['CountryName']; $selected = ""; if($countryid == $ID) $selected = "selected"; ?> <option value="<?php echo $ID; ?>" <?php echo $selected; ?>><?php echo $CountryName; ?></option> <?php } ?> </select> Add New Country <input type="text" name="newcountry" id="newcountry"> <input type="submit" value="Add New" class="bttn"> </td> <td style="width:9px;"></td> </tr> </table> </form> </td> </tr> <tr> <td valign="top" align="left" class="content_bg" style=" padding-left:3%"> <form method="post" action="shipping-mgmt.php" name="pricedetails" id="pricedetails" onSubmit="return validateform();" > <input type="hidden" name="requestfrom" id="requestfrom" value="PriceForm"> <input type="hidden" name="CID" id="CID" value="<?php echo $countryid;?>"> <table border="0" cellpadding="0" cellspacing="0" class="normal_text" align="left" style="padding-left:10px;"> <tr> <td class="tablehead" nowrap><strong>No</strong></td> <td class="tablehead" nowrap><strong>Qty From</strong></td> <td class="tablehead" nowrap><strong>Qty To</strong></td> <td class="tablehead"><strong>Shipping Rate</strong></td> </tr> <?php $sql = "select ShippingID, CountryID, QtyFrom,QtyTo,ShippingPrice from maintrainer_shippingdetails where CountryID= ".$countryid." order by QtyFrom"; $result =mysqli_query($conn,$sql); $i = 0; if($countryid > 0) while($row = mysqli_fetch_array($result)) { $i = $i + 1; $ShippingID = $row['ShippingID']; $CountryID = $row['CountryID']; $QtyFrom = $row['QtyFrom']; $QtyTo = $row['QtyTo']; $ShippingPrice = $row['ShippingPrice']; ?> <tr> <td><?php echo $i; ?></td> <td><input type="text" name="<?php echo "qtyfrom".$i; ?>" id="<?php echo "qtyfrom".$i; ?>" value="<?php echo $QtyFrom; ?>" style="width:120px;"></td> <td><input type="text" name="<?php echo "qtyto".$i; ?>" id="<?php echo "qtyto".$i; ?>" value="<?php echo $QtyTo; ?>" style="width:120px;"></td> <td><input type="text" name="<?php echo "ShippingPrice".$i; ?>" id="<?php echo "ShippingPrice".$i; ?>" value="<?php echo $ShippingPrice; ?>" style="width:120px;"></td> </tr> <?php } ?> <?php if($i < 10) { while($i < 10) { $i = $i + 1; $ShippingID = $row['ShippingID']; $CountryID = $row['CountryID']; $QtyFrom = $row['QtyFrom']; $QtyTo = $row['QtyTo']; $ShippingPrice = $row['ShippingPrice']; ?> <tr> <td><?php echo $i; ?></td> <td><input type="text" name="<?php echo "qtyfrom".$i; ?>" id="<?php echo "qtyfrom".$i; ?>" value="<?php echo $QtyFrom; ?>" style="width:120px;"></td> <td><input type="text" name="<?php echo "qtyto".$i; ?>" id="<?php echo "qtyto".$i; ?>" value="<?php echo $QtyTo; ?>" style="width:120px;"></td> <td><input type="text" name="<?php echo "ShippingPrice".$i; ?>" id="<?php echo "ShippingPrice".$i; ?>" value="<?php echo $ShippingPrice; ?>" style="width:120px;"></td> </tr> <?php } } ?> <tr> <td style="height:20px;"></td> </tr> <tr> <td align="center" colspan="4"><input type="submit" id="save" name="save" value="Save" class="bttn" > <input type="button" id="back" name="back" value="Cancel" class="bttn" onClick="javascript:history.back();"></td> <td style="width:9px;"></td> </tr> <tr> <td height="50"></td> </tr> </table> </form> </td> </tr> <tr> <td style="height:9px;"></td> </tr> </table> </TD> </TR> <?php include_once('include/include_footer.php'); ?> </TABLE> <!-- End ImageReady Slices --> </BODY> </HTML>