Exemple #1
0
             } else {
                 if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file)) {
                     $_POST['fileToUpload'] = $random_no . $_FILES["fileToUpload"]["name"];
                     //echo "The file ". basename( $_FILES["fileToUpload"]["name"]). " has been uploaded.";
                 } else {
                     echo "Sorry, there was an error uploading your file.";
                     die;
                 }
             }
         }
     }
 }
 $ID = $_POST['ID'];
 $arr = array("air_line_name" => $_POST['air_line_name'], "air_line_code" => $_POST['air_line_code'], "air_line_image" => $_POST['fileToUpload']);
 if (empty($ID)) {
     $nLastId = InsertRec("tblairlines", $arr);
 } else {
     UpdateRec('tblairlines', "air_line_id = '{$ID}'", $arr);
 }
 // Update Permissions for admin
 $SQL = "SELECT * FROM tblairlines ORDER BY air_line_name";
 $result = MySQLQuery($SQL);
 while ($row = mysql_fetch_array($result)) {
     $All_air_lines .= $row['air_line_id'] . ",";
 }
 $arrAirLine = array('user_permissions' => rtrim($All_air_lines, ","));
 $nLastID = UpdateRec('tbluser', "user_id = '1'", $arrAirLine);
 echo "upload";
 die;
 //header("Location: view_air_lines");
 break;
Exemple #2
0
function MainTainUserLog($strModuleName = "", $strAction = "", $strDocType = "", $strDocNo = "", $strRemarks = "", $strComputerName = "", $strUserName = "")
{
    $arr = array("log_module" => $strModuleName, "log_action" => $strAction, "log_doc_type" => $strDocType, "log_doc_no" => $strDocNo, "log_date" => date("Y-m-d"), "log_computer_name" => $_SERVER["REMOTE_ADDR"], "log_user_name" => $strUserName, "log_remarks" => $strRemarks);
    $nInsert = InsertRec("tblLog", $arr);
}
Exemple #3
0
        $image_name = $_FILES['images']['name'][$key];
        $tmp_name = $_FILES['images']['tmp_name'][$key];
        $size = $_FILES['images']['size'][$key];
        $type = $_FILES['images']['type'][$key];
        $error = $_FILES['images']['error'][$key];
        $finalImageName = $random_no . $image_name;
        ############ Remove comments if you want to upload and stored images into the "uploads/" folder #############
        $target_dir = "images/temp/";
        $target_file = $target_dir . $finalImageName;
        if (move_uploaded_file($_FILES['images']['tmp_name'][$key], $target_file)) {
            $images_arr[] = $target_file;
        }
        //Insert images gallery
        $arr = array('user_id' => $_POST['nUserID'], 'image_name' => $finalImageName);
        if (!empty($image_name)) {
            $nLastID = InsertRec("tblimages", $arr);
        }
    }
    //Generate images view
    $SQL = "SELECT * FROM tblimages WHERE user_id = '" . (int) $_POST['nUserID'] . "'";
    $result = MySQLQuery($SQL);
    while ($row = mysql_fetch_array($result)) {
        $count++;
        ?>
			<ul class="reorder_ul reorder-photos-list">
            	<li id="image_li_<?php 
        echo $count;
        ?>
" class="ui-sortable-handle">
                	<a href="javascript:void(0);" style="float:none;" class="image_link"><img src="images/temp/<?php 
        echo $row['image_name'];