ruạṛ
<?php /** * List and edit shipping locations * @version 0.9 * @author Robert Urquhart <programmer@activatedesign.co.nz> * @package WEP-CMS */ session_start(); require_once 'scripts-includes/universal.php'; require_once 'scripts-includes/display.php'; $connID = connect_to_db(); $shipping = mysql_query("select * from shipping order by position, location"); if(!$shipping || mysql_num_rows($shipping)<1) { $table = '<p class="center">No locations have been defined</p>'; } else { $table = '<table class="control_panel"> <thead> <tr> <th class="pad"></th> <th>Location</th> <th>Shipping Cost</th> <th class="control">Active</th> <th class="control">Position<br /><input type="submit" value="Update" class="update" /></th> <th class="control">Edit</th> <th class="control">Delete</th> <th class"pad"></th> </tr> </thead> <tfoot></tfoot> <tbody> '; while($s = mysql_fetch_assoc($shipping)) { $sid = $s['ship_id']; $cost = '$'.number_format($s['shipping_cost'],2); $table .= '<tr> <td> </td> <td>'.$s['location'].'</td> <td>'.$cost.'</td> <td><a href="processes/process-switch.php?f=active&ship='.$sid.'" class="toggle">'.onOrOff($s['active']).'</a></td> <td><input name="positions['.$sid.']" type="text" size="2" maxlength="3" class="ordering inline-editing" value="'.$s['position'].'" /></td> <td><a href="edit-shipping.php?ship='.$sid.'">Edit</a></td> <td><a href="processes/process-shipping-delete.php?ship='.$sid.'" onClick="if(confirm(\'Delete '.$s['location'].'?\')){return true}else{return false}" class="delete"><img src="images/img-del.png" alt="Delete" /></a></td> <td> </td> </tr> '; } $table .=' </tbody> </table>'; } head('orders','Administration Panel'); ?> <form name="add_shipping" id="add_shipping" action="processes/process-shipping-new.php" method="post" enctype="multipart/form-data" class="add"> <p class="center"> Location: <input name="location" id="location" type="text" size="30" value="" maxlength="60" /> at position <input name="position" id="position" type="text" size="2" maxlength="3" value="" placeholder="<?php echo select_one('shipping','max(position)')+10;?>" /> Cost: $<input name="shipping_cost" id="shipping_cost" type="text" size="4" value="" maxlength="7" /> Show now: <input name="active" id="active" type="checkbox" value="1" /> <input type="submit" name="add" value="Add location" /> </p> </form> <p> </p> <form action="processes/process-shipping-ordering.php" method="post" enctype="multipart/form-data"> <?php echo $table; ?> </form> <?php footer(); exit; ?>
cải xoăn