Exemplo n.º 1
0
 // HEIGHT
 if (isset($_POST['mold_height'])) {
     $mold->pm_set_mold_height($_POST['mold_height']);
 }
 // SHIPPING CLASS
 if (isset($_POST['mold_shipping_class'])) {
     $mold->pm_set_mold_shipping_class($_POST['mold_shipping_class']);
 }
 // RESET EVERYTHING
 if (isset($_POST['reset']) && $_POST['reset'] == "yes") {
     $mold->pm_default_values();
 }
 if ($_POST['action'] == 'new') {
     ## TEMPORARY SAVING ##
     ## We save to the temporary table ##
     $mold->pm_temporary_save();
 } else {
     if ($_POST['action'] == 'edit') {
         ## We save to the database ##
         $mold_id = $mold->pm_get_mold_id();
         $mold->pm_save_to_db($mold_id);
     }
 }
 ## SAVING TO DB ##
 ## This is when the temporary table will be suppressed ##
 if (isset($_POST['save']) && $_POST['save'] == "yes") {
     $mold->pm_save_to_db($mold_id);
     if (isset($_POST['action']) && $_POST['action'] == "new") {
         echo "<script> save_new(); </script>";
     }
 }