Location: PHPKode > projects > NOLA > adminarcarriermethupd.php
<? include('includes/main.php'); ?>
<? include('includes/arfunctions.php'); ?>
<?
     echo texttitle(STR_SHIPPING_METHOD_UPDATE);
     if ($carrierid) { //if carrier selected
          $recordSet = &$conn->Execute('select carrier.id,company.companyname from company,carrier where company.cancel=0 and carrier.companyid=company.id and carrier.id='.sqlprep($carrierid));
          if (!$recordSet||$recordSet->EOF) die(texterror(STR_COMPANY_NOT_FOUND));
          echo texttitle(" for Carrier: ".rtrim($recordSet->fields[1]));
          if ($carriermethodid) { //if shipping method selected
               if ($delete) { //if shipping method should be deleted
                    if (arcarriermethoddelete($carriermethodid)) echo textsuccess(STR_SHIPPING_METHOD_DELETED_SUCCESSFULLY);
                    $carriermethodid="";
               } elseif ($description) {  //if shipping method should be updated
                    if (arcarriermethodupdate($carriermethodid, $description)) echo textsuccess(STR_SHIPPING_METHOD_UPDATED_SUCCESSFULLY);
                    $carriermethodid="";
               } else { //edit shipping method
                 echo '<form action="adminarcarriermethupd.php" method="post"><input type="hidden" name="nonprintable" value="1"><table>';
                 echo '<input type="hidden" name="carrierid" value="'.$carrierid.'">';
                 echo '<input type="hidden" name="carriermethodid" value="'.$carriermethodid.'">';
                 formarcarriermethodupdate($carriermethodid);
                 echo '</table><input type="submit" value="'.STR_SAVE_CHANGES.'"></form><a href="javascript:confirmdelete(\'adminarcarriermethupd.php?delete=1&id='.$carriermethodid.'\')">'.STR_DELETE_THIS_METHOD.'</a>';
               };
          } elseif ($new) { //add a new shipping method
               if ($description) {
                    if (arcarriermethodadd($carrierid,$description)) echo textsuccess(STR_SHIPPING_METHOD_ADDED_SUCCESSFULLY);
                    $new="";
               } else {
                    echo '<form action="adminarcarriermethupd.php" method="post"><input type="hidden" name="nonprintable" value="1"><table>';
                    echo '<input type="hidden" name="carrierid" value="'.$carrierid.'">';
                    echo '<input type="hidden" name="new" value="1">';
                    echo '<tr><td align="'.TABLE_LEFT_SIDE_ALIGN.'">'.STR_DESCRIPTION.':</td><td><input type="text" name="description" size="30" maxlength="30"></td></tr>';
                    echo '</table><input type="submit" value="'.STR_ADD.'"></form>';
               };
          };
          if (!$carriermethodid&&!$new) { //select shipping method
               echo '<form action="adminarcarriermethupd.php" method="post"><table>';
               if (formarcarriermethodselect('carriermethodid', $carrierid)) echo '<input type="submit" value="'.STR_EDIT.'">';
               echo '</table></form><a href="adminarcarriermethupd.php?new=1&carrierid='.$carrierid.'">Add a new method</a>';
               echo '<br><br><a href="adminarcarriermethupd.php">Go to Carrier Selection</a>';
          };
     } else { //select carrier
          echo '<form action="adminarcarriermethupd.php" method="post"><table>';
          if (formarcarrierselect('carrierid')) echo '<input type="submit" value="'.STR_EDIT.'">';
          echo '</table></form>';
     };
?>
<? include('includes/footer.php'); ?>
Return current item: NOLA