Getfrank Interviews'; $add_new_heading = 'Add New Form'; $edit_heading = "Getfrank Interviews Form"; global $conn; $db = new sqlDb( $conn ); $_SESSION['msg'] = $msg = ''; if( $_POST['do_action']=='Delete' ){ if( is_array( $_POST['chk_slt'] ) && sizeof( $_POST['chk_slt'] ) > 0 ){ $dq = mysql_query("delete from $TBL_name where id in(".implode( ',', $_POST['chk_slt'] ).")"); if( $dq ){ header("location:$ThisURL"); exit(); } } } if( $_POST['do'] == 'Save Sort Order' ){ $chk_slt = $_POST['hdOrder']; (isset($_GET['page']))?$page=$_GET['page']:$page=0; $count = $_POST['total_recs']; while (list ($key, $val) = @each($chk_slt)) { mysql_query("update $TBL_name set sort_order=$count where id=$val" ); $count--; } } if($_POST['action']=='add-save' || $_POST['action']=='add-continue') { $N = $_POST['n']; if( $db->perform( $TBL_name, $N) ) { $mysql_id = mysql_insert_id(); $update = mysql_query("update $TBL_name set sort_order=id, image='".$icon_name."' where id=".$mysql_id); $msg = 'Record Inserted successfully!'; if($_POST['action']=='add-save') { header("location:$ThisURL"); exit(); } else{ header("location:$ThisURL?EditId=".$mysql_id); exit(); } } else echo mysql_error(); } if(isset($_POST['action']) && ($_POST['action']=='edit-save' || $_POST['action']=='edit-continue')) { $N = $_POST['n']; if( $db->perform( $TBL_name, $N,'update', "id={$ReqId}" ) ) { if($_POST['action']=='edit-save') { header("location:$ThisURL"); exit(); } }else echo mysql_error(); } $_SESSION['msg'] = $msg; if( $_POST['do_action'] == 'Update' && sizeof( $_POST['chk_slt'] ) > 0 ){ foreach( $_POST['chk_slt'] as $rec_id ){ mysql_query("update ".$TBL_name." set date_to_be_published='".$_POST['date_to_be_published_'.$rec_id]."', contacted='".$_POST['contacted_'.$rec_id]."', this_week='".$_POST['this_week_'.$rec_id]."' where id=".$rec_id); } } ?>