Exemplo n.º 1
4
function sendNewsletter($queueID = 0)
{
    if ($queueID == 0) {
        return false;
    }
    //wtf? not queueID was defined musta been a booboo!
    //k we need to umm grab the info from the queue
    $queueResults = dbQuery('SELECT e.*, t.* FROM email_queue AS e, email_templates AS t WHERE t.email_templates_id = e.email_template_id AND e.email_queue_id = ' . $queueID);
    $q = dbFetchArray($queueResults);
    //we have everything we need i believe!
    //lets send out the newsletter, then remove it from the queue and add to the sent table
    //the sent table will allow the admin to resend at anytime
    //include the class phpmailer()
    include_once 'classes/class.phpmailer.php';
    //now we need to get stuff!
    $content = output($q['email_templates_header']);
    $content .= output($q['email_queue_email_text']);
    $content .= output($q['email_templates_footer']);
    $q['content'] = $content;
    $recipients = explode(',', $q['email_queue_recipients']);
    foreach ($recipients as $key => $val) {
        $mail = new PHPMailer();
        $mail->From = output($q['email_queue_from']);
        $mail->FromName = output($q['email_queue_from']);
        $mail->isMail = true;
        $mail->Body = output($content);
        $mail->AddAddress($val);
        $mail->Subject = output($q['email_queue_subject']);
        //check to see if there is an attachment
        if ($q['email_queue_attachment'] != "") {
            $mail->AddAttachment(UPLOAD_DIR_NEWSLETTER . $q['email_queue_attachment'], $q['email_queue_attachment']);
        }
        $mail->ContentType = 'text/html';
        $mail->Send();
        $mail->ClearAddresses();
    }
    $row['client_id'] = 1;
    $row['email_queue_date_sent'] = time();
    $row['email_queue_subject'] = $q['email_queue_subject'];
    $row['email_queue_content'] = $q['content'];
    $row['email_templates_id'] = $q['email_template_id'];
    $row['email_recipients'] = $q['email_queue_recipients'];
    $row['email_display_home'] = $q['email_display_home'];
    dbPerform('email_queue_sent', $row, 'insert');
    dbQuery('DELETE FROM email_queue WHERE email_queue_id = ' . $q['email_queue_id']);
    return true;
}
Exemplo n.º 2
0
function orderoldfood()
{
    if (isset($_POST)) {
        $food_id = $_POST['food_id'];
        $food_name = $_POST['food_name'];
        $food_type = $_POST['food_type'];
        $add_amount = $_POST['add_amount'];
        $price_per = $_POST['price_per'];
        $total = $add_amount * $price_per;
    }
    $conn = dbConnect();
    if ($conn) {
        $sql0 = "SELECT AMOUNT FROM EMM_ZOO.FM_STOCK WHERE FOODID = {$food_id};";
        $stm = dbQuery($conn, $sql0);
        while ($row = dbFetchArray($conn, $stm)) {
            $amountx = $row[0];
        }
        $amount_now = $amountx + $add_amount;
        $sql1 = "INSERT INTO EMM_ZOO.FOODANIMAL_EXPENSE (FOODEXPENSE_ID,DATES,FOODID,COST,RESPONPERSONID) VALUES (DEFAULT,CURRENT DATE,{$food_id},{$total},'5678');";
        $cb = db2_exec($conn, $sql1);
        $sql2 = "UPDATE EMM_ZOO.FM_STOCK SET AMOUNT = {$amount_now} WHERE FOODID = {$food_id};";
        $cc = db2_exec($conn, $sql2);
        if ($cc && $cb) {
            $resultMessage = 1;
            return $resultMessage;
            header('Location: FoodStock.php#food_list');
        } else {
            $resultMessage = 0;
            return $resultMessage;
        }
        db2_free_stmt($stmt);
        db2_close($conn);
    }
}
Exemplo n.º 3
0
function get_available_calculators()
{
    $results = dbQuery('SELECT * FROM tools_calculators');
    while ($r = dbFetchArray($results)) {
        $c[] = array('id' => $r['tools_calculators_id'], 'name' => $r['tools_calculators_name']);
        echo "<li><label><input type=\"checkbox\" name=\"calculators[]\" value=\"" . $val['id'] . "\">" . $val['name'] . "</option></li>\n";
    }
    return $c;
}
Exemplo n.º 4
0
function getDateCreated($userID)
{
    $results = dbQuery('SELECT user_created FROM user WHERE user_id = ' . $userID);
    $row = dbFetchArray($results);
    if ($row['user_created'] == 0) {
        return "n/a";
    } else {
        return date('m/d/Y', $row['user_created']);
    }
}
Exemplo n.º 5
0
function carReturn()
{
    $up = "Y";
    if (isset($_POST)) {
        $empID = $_POST['empID'];
        $carID = $_POST['carID'];
        // an array that want to insert this can be multiple array at the time.
        // print var_dump to display an array of variable data with type that prepare for query.
        //echo var_dump($data) ."<br>";
    }
    // define $conn from model
    $conn = dbConnect();
    if ($conn) {
        // DEFAULT if you set generated as identify with specifier this will auto increament for integer.
        $delete = "DELETE FROM EMM_ZOO.CARS_BORROWED WHERE EMM_ZOO.CARS_BORROWED.CARID = '" . $carID . "';";
        $update = "UPDATE EMM_ZOO.CARS SET EMM_ZOO.CARS.AVAILABLE = '" . $up . "' WHERE EMM_ZOO.CARS.CARID = '" . $carID . "';";
        $guanteen = "SELECT AVAILABLE FROM EMM_ZOO.CARS WHERE EMM_ZOO.CARS.CARID = '" . $carID . "';";
        $ans = dbQuery($conn, $guanteen);
        $row = dbFetchArray($conn, $ans);
        if ($row[0] == 'Y' || $row[0] == 'y') {
            echo "<script type='text/javascript'>alert(' This car has not been borrowed yet');</script>";
            header("Refresh:0; url=returnCar.php");
        } else {
            $result = db2_exec($conn, $delete);
            if ($result) {
                $result2 = db2_exec($conn, $update);
                if ($result2) {
                    echo "<script type='text/javascript'>alert('CAR RETURNED');</script>";
                    header("Refresh:0; url=returnCar.php");
                } else {
                    echo "<script type='text/javascript'>alert('You need to fill all input OR Your employeeID,carID does not exist');</script>";
                    header("Refresh:0; url=TransportationEmployee.php");
                }
            } else {
                // If statement is error why see the code
                die('Critical error:' . db2_stmt_error($stmt));
            }
            db2_free_stmt($result);
            db2_free_stmt($result2);
        }
        db2_free_stmt($ans);
        db2_free_stmt($row);
        db2_close($conn);
    } else {
        echo db2_conn_errormsg($conn);
    }
}
Exemplo n.º 6
0
function recurseCategories($parent = 0, $count = 1)
{
    $sql = 'SELECT * FROM store_categories WHERE categories_parent = ' . $parent . ' ORDER BY categories_title ASC';
    for ($i = 0; $i <= $count; $i++) {
        $padding = 10 * $count;
    }
    $results = dbQuery($sql);
    while ($cInfo = dbFetchArray($results)) {
        echo "<tr>\n";
        echo "<td class=\"row" . $row . "\"><a href=\"" . PAGE_STORE . "?section=products&action=manage&c=" . $cInfo['categories_id'] . "\" title=\"" . output($cInfo['categories_title']) . "Products\"><img src=\"images/icons/folder_closed_16x16.gif\" width=\"16\" height=\"16\" border=\"0\" /></a></td>\n";
        echo "<td class=\"row" . $row . " pageTitleSub \"><img src=\"images/filler.gif\" width=\"" . $padding . "\" height=\"5\"> <a href=\"" . PAGE_STORE . "?section=products&action=manage&c=" . $cInfo['categories_id'] . "\" title=\"" . output($cInfo['categories_title']) . " Products\">" . output($cInfo['categories_title']) . "</a></td>\n";
        echo "<td class=\"row" . $row . "\">" . date('m/d/Y', $cInfo['categories_date_added']) . "</td>\n";
        echo "<td width=\"50\" class=\"row" . $row . "\"><a href=\"" . PAGE_STORE_CATEGORIES . "&action=editcategory&id=" . $cInfo['categories_id'] . "\" title=\"Edit " . output($cInfo['categories_title']) . "\" ><img src=\"images/icons/edit_16x16.gif\" width=\"16\" height=\"16\" border=\"0\" /></a> | <a href=\"" . PAGE_STORE . "?action=deletecategory&id=" . $cInfo['categories_id'] . "\" onclick=\"return confirm('Are you sure you want to delete " . $cInfo['categories_title'] . "?');\"><img src=\"images/icons/delete_16x16.gif\" width=\"16\" height=\"16\" border=\"0\" /></a></td>\n";
        echo "</tr>\n";
        recurseCategories($cInfo['categories_id'], $count + 1);
    }
}
Exemplo n.º 7
0
function ordernewfood()
{
    if (isset($_POST)) {
        $food_name = $_POST['food_name'];
        $food_type = $_POST['food_type'];
        $add_amount = $_POST['add_amount'];
        $price_per = $_POST['price_per'];
        $total = $add_amount * $price_per;
        $username = $_POST['username'];
        $data = array($food_name, $food_type, $add_amount, $price_per);
    }
    $conn = dbConnect();
    if ($conn) {
        $conn = dbConnect();
        $sql0 = "INSERT INTO EMM_ZOO.FM_STOCK (FOODID,FOODNAME,TYPE,AMOUNT,PERAMOUNT) VALUES(DEFAULT,'{$food_name}','{$food_type}',{$add_amount}, {$price_per})";
        $ca = db2_exec($conn, $sql0);
        if ($ca) {
            $resultMessage = 1;
            return $resultMessage;
        } else {
            $resultMessage = 0;
            return $resultMessage;
        }
        $sql1 = "SELECT FOODID FROM EMM_ZOO.FM_STOCK WHERE FOODNAME = '{$food_name}';";
        $stm = dbQuery($conn, $sql);
        while ($row = dbFetchArray($conn, $stm)) {
            $foodidx = $row[0];
        }
        $sql2 = "INSERT INTO EMM_ZOO.FOODANIMAL_EXPENSE (FOODEXPENSE_ID,DATES,FOODID,COST,RESPONPERSONID) VALUES (DEFAULT,current date,{$foodidx},{$total},{$username});";
        $sc = db2_exec($conn, $sql2);
        if ($sc) {
            $resultMessage = 1;
            return $resultMessage;
            header('Location: FoodStock.php#order_new');
            exit;
        } else {
            $resultMessage = 0;
            return $resultMessage;
        }
        db2_free_stmt($stmt);
        db2_close($conn);
    }
}
Exemplo n.º 8
0
function exportfood()
{
    if (isset($_POST)) {
        $food_id = $_POST['food_id2'];
        $food_name = $_POST['food_name2'];
        $food_type = $_POST['food_type2'];
        $out_amount = $_POST['out_amount'];
        $username = $_SESSION['current_user_name'];
    }
    $conn = dbConnect();
    if ($conn) {
        $sql0 = "SELECT AMOUNT FROM EMM_ZOO.FM_STOCK WHERE FOODID = {$food_id};";
        $stm = dbQuery($conn, $sql0);
        while ($row = dbFetchArray($conn, $stm)) {
            $amountx = $row[0];
        }
        $amount_now = $amountx - $out_amount;
        if ($amount_now > 0) {
            $sql1 = "UPDATE EMM_ZOO.FM_STOCK SET AMOUNT = {$amount_now} WHERE FOODID = {$food_id};";
            $cz = db2_exec($conn, $sql1);
            $sql2 = "INSERT INTO EMM_ZOO.FOOD_GIVE(GIVENO,FOODID,EMPID,FOODNAME,FOODTYPE,AMOUNT,GIVETIME,ANIMAL) VALUES (DEFAULT,'{$food_id}','5678','{$food_name}','{$food_type}',{$out_amount},NULL,NULL);";
            $cb = db2_exec($conn, $sql2);
            if ($cb && $cz) {
                $resultMessage = 1;
                return $resultMessage;
                header('Location: FoodStock.php#food_list');
            } else {
                $resultMessage = 0;
                return $resultMessage;
            }
            db2_free_stmt($stmt);
            db2_close($conn);
        } else {
            echo "<script language='javascript'>alert('Not enough food!');</script>";
        }
    }
}
Exemplo n.º 9
0
function recurse_pages($id = 0, $level = 0)
{
    $level++;
    $sql = "SELECT * FROM page_content WHERE parent = " . $id . " ORDER BY page_content_title ASC";
    $pageResults = dbQuery($sql);
    $count = 0;
    while ($pInfo = dbFetchArray($pageResults)) {
        $padding = 18 * $level;
        if ($level != 1) {
            $style = "style=\"padding-left:" . ($padding + 18) . "px; background-repeat:no-repeat; background-position:" . $padding . "px 0px; background-image:url(images/directory_arrow.gif);\"";
        } else {
            $class = "";
        }
        //SECURITY CHECK
        //ONLY SHOW PAGES THAT THE USER HAS ACCESS TOO
        $row = $count % 2;
        echo "<tr>\n";
        echo "<td  nowrap width=\"1\">\n";
        if ($pInfo['page_content_member']) {
            echo "<a href=\"javascript:void(0);\" title=\"Membership Required\"><img src=\"images/icons/lock_16x16.gif\" border=\"0\"><a>";
        }
        echo "</td>\n";
        echo "<td nowrap width\"1\">" . date('m/d/Y', $pInfo['page_content_publish_date']) . "</td>\n";
        echo "<td " . $style . "><a href=\"" . PAGE_MANAGE . "?action=edit&section=webpage&id=" . $pInfo['page_content_id'] . "\">" . output($pInfo['page_content_title']) . "</a></td>\n";
        echo "<td nowrap width\"1\">";
        if ($pInfo['page_content_status'] == 'pending') {
            echo "<span class=\"textPending\">Pending</span>";
        } else {
            if ($pInfo['page_content_status'] == 'published') {
                echo "<span class=\"textActive\">Published</span>";
            } else {
                echo "<span class=\"textInactive\">Unpublished</span>";
            }
        }
        echo "</td>\n";
        echo "<td nowrap width\"1\">\n";
        echo "<span class=\"smallText\"><abbr title=\"by " . getAuthor($pInfo['page_content_author']) . "\" style=\"margin:2px;\">Created: " . date('m/d/y g:i a', $pInfo['page_content_added']) . " </abbr></span>\n";
        //check to see if this page has been edited
        //display
        $modifiedResults = dbQuery('SELECT * FROM page_content_log WHERE page_content_id = ' . $pInfo['page_content_id'] . ' LIMIT 1');
        if (dbNumRows($modifiedResults)) {
            $m = dbFetchArray($modifiedResults);
            echo "<br>";
            echo "<span class=\"smallText\" style=\"font-style:italic;\"><abbr style=\"margin:2px;\" title=\"by " . getAuthor($m['user_id']) . "\">Last Modified: " . date('m/d/y g:i a', $m['page_content_log_timestamp']) . "</abbr></span>";
        }
        echo "</td>\n";
        echo "<td align=\"right\" >";
        if ($level == 1) {
            echo "<a class=\"table_addsubpage_link\" href=\"" . PAGE_PUBLISH . "?section=webpage&parent=" . $pInfo['page_content_id'] . "\" title=\"Add Sub Page\">Add Subpage</a>";
            echo " ";
        }
        if (user_has_permission('banners')) {
            //echo "<a class=\"table_banner_link\" href=\"".PAGE_MANAGE."?action=banners&section=webpage&id=".$pInfo['page_content_id']."\" title=\"Add Banner\">Advert</a>\n";
            //echo " ";
        }
        if (user_has_permission('content') && user_has_page_permissions($pInfo['page_content_id'])) {
            echo "<a class=\"table_edit_link\" href=\"" . PAGE_MANAGE . "?action=edit&section=webpage&id=" . $pInfo['page_content_id'] . "\" title=\"Edit " . output($pInfo['page_content_title']) . "\">Edit</a>\n";
            echo " ";
        }
        if (user_has_permission('admin')) {
            echo "<a class=\"table_delete_link\" href=\"" . PAGE_MANAGE . "?action=delete&section=webpage&id=" . $pInfo['page_content_id'] . "\" title=\"Delete " . output($pInfo['page_content_title']) . "\" onclick=\"return confirm('Are you sure you want to delete this page? THIS IS NOT UNDOABLE');\">Delete</a>\n";
        }
        echo "</td>\n";
        echo "</tr>\n";
        recurse_pages($pInfo['page_content_id'], $level);
        $count++;
    }
}
Exemplo n.º 10
0
																	while($imgInfo = dbFetchArray($imgCheck))
																	{
																		echo "<tr>";
																		echo "<td value=\"top\" class=\"pageTitleSub\">Image: <br /><span style=\"font-size:10px; font-weight:normal\">(click to enlarge)</a></td>";
																		echo "<td><a href=\"".STORE_IMAGE_URL . $imgInfo['products_images_filename']."\" target=\"_blank\" class=\"title\"><img src=\"".STORE_IMAGE_URL . getThumbnailFilename($imgInfo['products_images_filename'], 'thumb')."\" /><br /><a href=\"store.php?action=deleteproductimage&id=".$imgInfo['products_images_id']."&pid=".$_GET['id']."\">Delete</a></td>";
																		echo "</tr>";
																	}
																}
															  }
															  ?>
													        <tr>
													          <td class="pageTitleSub">Category</td>
													          <td class="pageTitleSub"><select name="c" id="c" class="textField-title">
													            <?
															  $categories = dbQuery('SELECT * FROM store_categories ORDER BY categories_title');
															  while($cInfo = dbFetchArray($categories)) {
																echo "<option value=\"".$cInfo['categories_id']."\"";
																	if($cInfo['categories_id'] == $_GET['c'])
																		echo " selected";
																echo ">".output($cInfo['categories_title'])."</option>\n";
															  }
															  ?>
													            </select></td>
												            </tr>
													        <?
															  if($_GET['action'] == 'editproduct') { //check to see if an image already exists if so then we want to allow the user to view the image
																if($pInfo['products_info_custom_6'] != "") {
																	echo "<tr>";
																	echo "<td valign=\"top\" class=\"pageTitleSub\">Current Spec Sheet <br><span style=\"font-size:10px; font-weight:normal;\">(click to enlarge)</a></td>";
																	echo "<td>";
																	echo "<a href=\"../files/".$pInfo['products_info_custom_6']."\" target=\"_blank\" class=\"title\">[view spec sheet]</a>";	
Exemplo n.º 11
0
<?php

include 'dbInterface.php';
$q = $_GET["q"];
$con = dbConnect();
$sql = "SELECT * FROM cliente WHERE idCliente = '" . $q . "'";
$result = dbExecQuery($sql, $con);
$row = dbFetchArray($result);
echo '<td>' . $row['idCliente'] . "</td>";
echo "<td>" . $row['nomeCliente'] . "</td>";
dbCloseConnection($con);
Exemplo n.º 12
0
function uploadSold()
{
    if (isset($_POST)) {
        $product_id = $_POST['product_id'];
        $amount = $_POST['amount'];
        $date = $_POST['date'];
        $location = $_POST['location'];
        //$location= $_POST['location'];
        $price = "SELECT EMM_ZOO.PRODUCT.PRICE FROM EMM_ZOO.PRODUCT WHERE EMM_ZOO.PRODUCT.PRODUCTNO = " . $product_id . ";";
        $start = "SELECT EMM_ZOO.PROMOTION.PROSTART FROM EMM_ZOO.PROMOTION WHERE EMM_ZOO.PROMOTION.PRODUCTNO = " . $product_id . ";";
        $end = "SELECT EMM_ZOO.PROMOTION.PROEND FROM EMM_ZOO.PROMOTION WHERE EMM_ZOO.PROMOTION.PRODUCTNO = " . $product_id . ";";
        $discount = "SELECT EMM_ZOO.PROMOTION.PROTYPE FROM EMM_ZOO.PROMOTION WHERE EMM_ZOO.PROMOTION.PRODUCTNO = " . $product_id . ";";
        // $price= $_POST['price'];
        // $toatl =$price*$amount;
        // an array that want to insert this can be multiple array at the time.
        //$data = array( $product_id ,$price*$amount, $amount, $date);
        // print var_dump to display an array of variable data with type that prepare for query.
        //echo var_dump($data) ."<br>";
    }
    // define $conn from model
    $conn = dbConnect();
    if ($conn) {
        // DEFAULT if you set generated as identify with specifier this will auto increament for integer.
        $select = "SELECT PRICE FROM PRODUCT WHERE PRODUCTNO = " . $product_id . ";";
        $sql = 'INSERT INTO EMM_ZOO.HISTORYSOLD(RUNNINGNO,PRODUCTNO,PRICE,AMOUNT,DATEE)  VALUES (DEFAULT,?,?,?,?);';
        $update = "UPDATE EMM_ZOO.SHOP_STOCK  SET EMM_ZOO.SHOP_STOCK.AMOUNT = EMM_ZOO.SHOP_STOCK.AMOUNT - '" . $amount . "' \n           WHERE EMM_ZOO.SHOP_STOCK.PRODUCTNO = '" . $product_id . "'  \n           AND EMM_ZOO.SHOP_STOCK.SHOPLOCATION = '" . $location . "';";
        echo $sql;
        // prepare statement using connection and sql
        $stmt = db2_prepare($conn, $sql);
        $stmt2 = db2_exec($conn, $update);
        $result3 = dbQuery($conn, $start);
        $startrow = dbFetchArray($conn, $result3);
        $result4 = dbQuery($conn, $end);
        $endrow = dbFetchArray($conn, $result4);
        $result5 = dbQuery($conn, $price);
        $pricerow = dbFetchArray($conn, $result5);
        $result6 = dbQuery($conn, $discount);
        $discountrow = dbFetchArray($conn, $result6);
        echo $location;
        if ($date < $endrow[0] && $date > $startrow[0]) {
            $pricerow[0] = $pricerow[0] - $pricerow[0] * $discountrow[0] / 100;
        }
        $data2 = array($product_id, $pricerow[0] * $amount, $amount, $date);
        // If statement is valid execute it to db2
        if ($stmt) {
            //echo "SQL is valid<br>";
            $result = db2_execute($stmt, $data2);
            if ($result) {
                $resultMessage = "Successfully added to parking reserved";
                //echo "Successfully added";
                header("Refresh:0; url=sold.php");
                // you must refresh page after insert, define specific page you want to refresh , header("Refresh:0"); it mean refresh current page
            } else {
                $resultMessage = "Failed to query into database";
            }
        }
        if ($stmt2) {
            print "Updated successfully\n";
        }
        //else { // If statement is error why see the code
        //   die('Critical error:' . db2_stmt_error($stmt2));
        //}
        db2_free_stmt($stmt);
        //db2_free_stmt($stmt2);
        db2_close($conn);
    } else {
        echo db2_conn_errormsg($conn);
    }
}
Exemplo n.º 13
0
<?php

include 'application.php';
//what section
switch ($_GET['load']) {
    case 'header':
        //get html for header =)
        $headeResults = dbQuery('SELECT email_templates_header FROM email_templates WHERE email_templates_id = ' . $_GET['id']);
        if (!dbNumRows($headeResults)) {
            echo "no Results!";
        }
        $h = dbFetchArray($headeResults);
        echo html_entity_decode(output($h['email_templates_header']));
        break;
    case 'footer':
        //get html for header =)
        $headeResults = dbQuery('SELECT email_templates_footer FROM email_templates WHERE email_templates_id = ' . $_GET['id']);
        $h = dbFetchArray($headeResults);
        echo html_entity_decode(output($h['email_templates_footer']));
        break;
    case 'body':
        //get html for header =)
        $headeResults = dbQuery('SELECT email_templates_body FROM email_templates WHERE email_templates_id = ' . $_GET['id']);
        $h = dbFetchArray($headeResults);
        echo "<textarea name=\"emailTemplateBody\" id=\"mceEditor\">" . output($h['email_templates_body ']), "</textarea>\n";
        break;
}
Exemplo n.º 14
0
<?php

//used in conjuction with the gallery area
//display form to add caption and set sort order number.
include 'application.php';
if (!isset($_GET['page'])) {
    echo "Page is not set!";
}
$galleryResults = dbQuery('SELECT * FROM page_gallery_images WHERE page_gallery_image_id =  ' . $_GET['image_id']);
$gal = dbFetchArray($galleryResults);
?>
 


<table width="100%" border="0" cellspacing="0" cellpadding="5">
    <tr>
      <td align="right"><a href="#" class="jqmClose"><em>Close</em></a></td>
    </tr>
  </table>
<div class="success" style="display:none;">Saved image successully <a href="javascript:void(0);" onClick="location.reload(true);">Close and refresh window</a></div>
<div class="error" style="display:none;">Whoops, there was an error saving your information<br /><a href="#" id="jqmClose">Close Window</a></div>
<div id="imageForm">
<form id="imagePageCaptionForm" method="post" action="savePageCaption.php">
<input type="hidden" name="action" value="save" />
<input type="hidden" name="page_content_id" id="page_content_id" value="<?php 
echo $_GET['page'];
?>
" />
<input type="hidden" name="image_id" id="image_id" value="<?php 
echo $_GET['image_id'];
?>
Exemplo n.º 15
0
                                        <td><input name="subscriber_zipcode" type="text" class="textField-title" id="subscriber_zipcode" value="<?=$sInfo['subscriber_zipcode']?>" style="width:300px;" /></td>
                                      </tr>
                                      <tr>
                                        <td><strong>Notes</strong></td>
                                        <td>
                                        <textarea name="subscriber_notes" id="subscriber_notes" style="width:300px;" class="textField-title"><?=output($sInfo['subscriber_notes'])?></textarea>
                                        </td>
                                      </tr>
                                      <tr>
                                     	<td valign="top" class=""><strong>Attach contact to list</strong></td>
                                        <td>
                                                <div class="selection">
                                                <ul>
                                                    <?php
                                                    $listResults = dbQuery('SELECT * FROM subscriber_lists ORDER BY subscriber_lists_name ASC');
                                                    while($lInfo = dbFetchArray($listResults)) {
                                                        echo "<li>";
														echo "<label><input type=\"checkbox\" name=\"lists[]\" id=\"list_".$lInfo['subscriber_lists_id']."\"";
                                                        if(is_array($contactLists)) {
                                                            if( in_array( $lInfo['subscriber_lists_id'], $contactLists)) echo " checked";
                                                        }
                                                        echo " value=\"".$lInfo['subscriber_lists_id']."\">".output($lInfo['subscriber_lists_name'])."</label></li>\n";
                                                    }	
                                                    ?>
                                                </ul>
                                                </div>
                                        	</td>
                                        </tr>
                                        </table>
                                     
                                      </td>
Exemplo n.º 16
0
<?
include 'application.php';


	if (isset($_POST["loginsent"])) {

		//check to see if user exists and set cookie and sessions!
		$userResults = dbQuery('SELECT * FROM user WHERE user_name = "'.$_POST['uname'].'" AND user_password="******"');
		
		if(dbNumRows($userResults)) {
			//user exists!
			$user = dbFetchArray($userResults);
			$infoResults = dbQuery('SELECT * FROM user_information WHERE user_id = ' . $user['user_id']);
			$info = dbFetchArray($infoResults);
			
			$_SESSION['client'] = $user['client_id'];
			$_SESSION['user_id'] = $user['user_id'];
			$_SESSION['user_name'] = $info['user_first_name'].' '.$info['user_last_name'];
			$_SESSION['user_logged_in'] = true;
			$_SESSION['mc_rootpath'] = MEDIA_LIBRARY_PATH;
			
			//get users access and set it to a session it will be an array of areas to which this user has access to.
			$accessValues = $user['user_access'];
			
			if(strstr($accessValues,  ",")) {
				$values = explode(',', $accessValues);
				foreach($values as $key=>$val) {
					$accessArray[] = $val;	
				}
			} else {
				$accessArray[] = $user['user_access'];
Exemplo n.º 17
0
function modifythumbnails()
{
    $sql = "SELECT pd_image, pd_thumbnail FROM tbl_Course where (pd_image!='')";
    $result = dbQuery($sql) or die('Cannot get Course. ' . mysql_error());
    while ($row = dbFetchArray($result)) {
        list($bigimage, $thumbimage) = $row;
        if ($thumbimage != '') {
            rename(SRV_ROOT . 'images/Course/' . $thumbimage, SRV_ROOT . 'images/Course/remainings/' . $thumbimage);
        }
        createThumbnail(SRV_ROOT . 'images/Course/' . $bigimage, SRV_ROOT . 'images/Course/' . $thumbimage, 100);
    }
    header("Location: index.php");
}
Exemplo n.º 18
0
function dbNumRecords($table, $where="") {

	if($where == ""){

		$result = dbQuery("SHOW TABLE STATUS LIKE '$table'");

//		$result = dbQuery("SELECT COUNT(*) FROM $table");

		$rec = dbFetchArray($result);

		return $rec["Rows"];

	}

	else{

		$where = str_replace("%", $table . "_", $where);

		$result = dbQuery("SELECT COUNT(*) FROM $table WHERE $where");

		$rec = dbFetchArray($result);

		return $rec[0];

	}

}
Exemplo n.º 19
0
function print_gallery_image_thumbs($galleryID, $display = "*", $type = "div")
{
    $sql = 'SELECT * FROM gallery_images WHERE gallery_id = ' . $galleryID . ' AND gallery_image_featured = 0 ORDER BY gallery_image_sort_order';
    $imgResults = dbQuery($sql);
    if (dbNumRows($imgResults)) {
        echo "<h1>Current Images</h1>\n";
        if ($type == "ul") {
            echo "<ul>\n";
            while ($img = dbFetchArray($imgResults)) {
                if ($img['gallery_image_featured'] == 1) {
                    $featured = " featured";
                } else {
                    $featured = "";
                }
                echo "<li class=\"sortableitem\"><a href=\"editimage.php?gallery=" . $galleryID . "&image_id=" . $img['gallery_image_id'] . "\" class=\"galleryThumb modal " . $featured . "\" ><img border=\"0\" src=\"" . UPLOAD_DIR_URL . getThumbnailFilename($img['gallery_image_filename'], 'thumb') . "\" class=\"gallery_img\" /></a></li>\n";
            }
            echo "</ul>\n";
        }
        if ($type == "div") {
            echo "<div id=\"gallery_current_images\" align=\"center\">";
            $featuredResults = dbQuery('SELECT * FROM gallery_images WHERE gallery_id = ' . $galleryID . ' AND gallery_image_featured = 1 ORDER BY gallery_image_sort_order');
            while ($feature = dbFetchArray($featuredResults)) {
                if ($feature['gallery_image_featured'] == 1) {
                    $featured = " featured";
                } else {
                    $featured = "";
                }
                echo "<div id=\"img_" . $img['gallery_image_id'] . "\" class=\"galeryImg featuredImg\">";
                echo "<a href=\"editimage.php?gallery=" . $galleryID . "&image_id=" . $feature['gallery_image_id'] . "\" class=\"galleryThumbFeatured modal " . $featured . "\" title=\"" . $feature['gallery_image_caption'] . "\" ><img border=\"0\" src=\"" . UPLOAD_DIR_URL . getThumbnailFilename($feature['gallery_image_filename'], 'small') . "\" class=\"gallery_img_featured\" /><br><strong>Sort#:</strong>" . $feature['gallery_image_sort_order'] . "</a>";
                echo "</div>\n";
            }
            echo "<div class=\"clear\"></div>\n";
            while ($img = dbFetchArray($imgResults)) {
                if ($img['gallery_image_featured'] == 1) {
                    $featured = " featured";
                } else {
                    $featured = "";
                }
                echo "<div id=\"img_" . $img['gallery_image_id'] . "\" class=\"galeryImg\">";
                echo "<a href=\"editimage.php?gallery=" . $galleryID . "&image_id=" . $img['gallery_image_id'] . "\" class=\"galleryThumb modal " . $featured . "\" title=\"" . $img['gallery_image_caption'] . "\" ><img border=\"0\" src=\"" . UPLOAD_DIR_URL . getThumbnailFilename($img['gallery_image_filename'], 'thumb') . "\" class=\"gallery_img\" /><br><strong>Sort#:</strong>" . $img['gallery_image_sort_order'] . "</a>";
                echo "</div>\n";
            }
            echo "<div class=\"clear\"></div>\n";
            echo "</div>";
        }
    }
}
Exemplo n.º 20
0
function sendNewsletter($queueID = 0, $startfrom = 0)
{
    if ($queueID == 0) {
        return false;
    }
    //wtf? not queueID was defined musta been a booboo!
    //k we need to umm grab the info from the queue
    $queueResults = dbQuery('SELECT * FROM email_queue WHERE email_queue_id = ' . $queueID);
    $q = dbFetchArray($queueResults);
    /*
     */
    //we have everything we need i believe!
    //lets send out the newsletter, then remove it from the queue and add to the sent table
    //the sent table will allow the admin to resend at anytime
    //include the class phpmailer()
    //now we need to get stuff!
    //$content .= output($q['email_templates_header']);
    //buid web version!
    //$content .= output($q['email_templates_footer']);
    /*Create HTML VERSION! added 5/28/10 */
    //create friendy name
    $newsFile = buildHTMLFilename($q['email_queue_subject']);
    /* END Create HTML Version */
    $htmlContent = "<html>";
    $htmlContent .= "<head>";
    $htmlContent .= "<title></title>";
    $htmlContent .= "</head>";
    $htmlContent .= "<body style=\"margin:0px; padding:0px;\">\n";
    $htmlContent .= "<style>" . file_get_contents(SITE_PATH . "manage/css/cms.css") . "</style>";
    $content .= "<div style=\"font-size:10px; padding:5px; border:1px solid #666;\">\n";
    $content .= "<a href=\"" . UPLOAD_DIR_NEWSLETTER_URL . $newsFile . "\" target=\"_blank\" style=\"font-size:10px;\">Web Version</a><br />\n";
    $content .= "You received this email as a guest of  " . COMPANY_NAME . "<br />";
    $content .= "To ensure delivery, please add " . $q['email_queue_from'] . " to your address book or safe senders list<br />\n";
    $content .= "</div>\n";
    $content .= output($q['email_queue_email_text']);
    $htmlContent .= output($q['email_queue_email_text']);
    $content .= "<div style=\"font-size:10px; padding:5px; border:1px solid #666;\">\n";
    $content .= "<span style=\"font-size:13px; font-weight:bold;\">How to unsubscribe</span><br>\n";
    $content .= "If you no longer wish to receive emails from  " . COMPANY_NAME . " simply <a href=\"" . NEWSLETTER_UNSUBSCRIBE_URL . "\">unsubscribe</a><br><br>\n";
    $content .= "</div>\n";
    $htmlContent .= "</body>";
    $htmlContent .= "</html>";
    $newsletterFilename = UPLOAD_DIR_NEWSLETTER . $newsFile;
    $pointer = fopen($newsletterFilename, 'w');
    //open file/creates if doesn't exist!
    fwrite($pointer, $htmlContent);
    fclose($pointer);
    if ($q['email_queue_recipients'] != "all") {
        $recipients = explode(',', $q['email_queue_recipients']);
        foreach ($recipients as $key => $val) {
            $mail = new PHPMailer();
            $mail->From = output($q['email_queue_from']);
            $mail->FromName = output($q['email_queue_from']);
            $mail->isMail = true;
            $mail->Body = output($content);
            $mail->AddAddress($val);
            $mail->Subject = output($q['email_queue_subject']);
            //check to see if there is an attachment
            if ($q['email_queue_attachment'] != "") {
                $mail->AddAttachment(UPLOAD_DIR_NEWSLETTER . $q['email_queue_attachment'], $q['email_queue_attachment']);
            }
            $mail->ContentType = 'text/html';
            $mail->Send();
            $mail->ClearAddresses();
        }
    } else {
        //we need to just go through the subscribers table and send it out that way to ensure they are being delivered!
        if ($startfrom != 0) {
            $where = " WHERE subscriber_id > " . $startfrom;
        } else {
            $where = "";
        }
        $recipResults = dbQuery("SELECT subscriber_email_address, subscriber_name FROM subscribers " . $where);
        set_time_limit(0);
        while ($r = dbFetchArray($recipResults)) {
            $mail = new PHPMailer();
            $mail->From = output($q['email_queue_from']);
            $mail->FromName = output($q['email_queue_from']);
            $mail->isMail = true;
            $mail->Body = output($content);
            $mail->AddAddress($r['subscriber_email_address']);
            $mail->Subject = output($q['email_queue_subject']);
            //check to see if there is an attachment
            if ($q['email_queue_attachment'] != "") {
                $mail->AddAttachment(UPLOAD_DIR_NEWSLETTER . $q['email_queue_attachment'], $q['email_queue_attachment']);
            }
            $mail->ContentType = 'text/html';
            $mail->Send();
            $mail->ClearAddresses();
        }
    }
    $row['client_id'] = 1;
    $row['email_queue_date_sent'] = time();
    $row['email_queue_subject'] = $q['email_queue_subject'];
    $row['email_queue_content'] = $q['email_queue_email_text'];
    $row['email_templates_id'] = $q['email_template_id'];
    $row['email_recipients'] = $q['email_queue_recipients'];
    $row['email_display_home'] = $q['email_display_home'];
    $row['email_log_file'] = $logFileName;
    dbPerform('email_queue_sent', $row, 'insert');
    dbQuery('DELETE FROM email_queue WHERE email_queue_id = ' . $queueID);
    return true;
}
Exemplo n.º 21
0
<?php

include '../master.inc.php';
include '../application.php';
//we are going to send out any communications that are in the queue.
$start = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
$end = mktime(23, 59, 59, date('m'), date('d'), date('Y'));
echo date("F j, Y, g:i a", $start) . "<br>";
echo date("F j, Y, g:i a", $end) . "<br><br>";
$queueResults = dbQuery('SELECT * FROM email_queue WHERE email_queue_release_date BETWEEN "' . $start . '" AND "' . $end . '" AND email_queue_status = "pending"');
if (dbNumRows($queueResults)) {
    //send out the newsletters!
    //we want to include the class file
    $count = 0;
    while ($q = dbFetchArray($queueResults)) {
        sendNewsletter($q['email_queue_id']);
        $count++;
    }
    echo "Sent " . $count . " newsletters at " . date("F j, Y, g:i a", time());
}
Exemplo n.º 22
0
                        <?php 
if ($conn) {
    echo "<div class='form-group col-lg-6'>\n                                <label>Job Type</label>\n                                <select name='jobid'  class='form-control'>\n                                        <option value='' disabled selected>Please choose job types</option>";
    $sql = "SELECT JOBTYPE, JOBID FROM EMM_ZOO.JOB;";
    $stmt = dbQuery($conn, $sql);
    if ($stmt == FALSE) {
        die('Critical error: ' . db2_stmt_error($stmt));
    }
    while ($row = dbFetchArray($conn, $stmt)) {
        echo "\n                                                \n                                                <option value='{$row['1']}'>{$row['0']}</option>";
    }
    echo "</select><br>\n                                \n                            </div>";
    echo "<div class='form-group col-lg-12'><center>";
    $sql = "SELECT MAX(EMPID) FROM EMM_ZOO.EMPLOYEE;";
    $stmt = dbQuery($conn, $sql);
    $row = dbFetchArray($conn, $stmt);
    $id = $row[0] - 1;
    echo "<input name = 'id' type='hidden' value = '{$id}'>";
    db2_free_stmt($stmt);
    db2_close($conn);
} else {
    echo "Connection failed" . db2_conn_errormsg($conn);
}
?>
                                <button type="submit" class="btn btn-success">SUBMIT</button>
                                <button type="button" onclick="history.back()" class="btn btn-success">CANCEL</button></center>
                            </div>
                                
                   <div class="clearfix"></div>             
                </form>
                
Exemplo n.º 23
0
function Animal()
{
    $up = "N";
    if (isset($_POST)) {
        $empID = $_POST['empID'];
        $animalID = $_POST['animalID'];
        $species = $_POST['species'];
        $approvalID = $_POST['approvalID'];
        $destination = $_POST['destination'];
        $start = $_POST['start'];
        $end = $_POST['end'];
        $animalExpertID = $_POST['animalExpertID'];
        $total = $_POST['total'];
        $carID = $_POST['carID'];
        // an array that want to insert this can be multiple array at the time.
        $data = array($empID, $animalID, $animalExpertID, $species, $start, $destination, $approvalID, $total, $carID);
        $databorrow = array($carID, $empID, $start, $end);
        // print var_dump to display an array of variable data with type that prepare for query.
        //echo var_dump($data) ."<br>";
    }
    // define $conn from model
    $conn = dbConnect();
    if ($conn) {
        // DEFAULT if you set generated as identify with specifier this will auto increament for integer.
        $sql = 'INSERT INTO EMM_ZOO.TRANSPORT(TRANSPORTATIONNO,EMPLOYEEID, ANIMALID, ANIMALEXPERTID, ANIMALSPECIES,STARTDATE,DESTINATION,APPROVEID,TOTALOFANIMAL,CARID) VALUES (DEFAULT,?,?,?,?,?,?,?,?,?);';
        $update = "UPDATE EMM_ZOO.CARS SET EMM_ZOO.CARS.AVAILABLE = '" . $up . "' WHERE EMM_ZOO.CARS.CARID = '" . $carID . "';";
        $sql2 = "SELECT AVAILABLE FROM EMM_ZOO.CARS WHERE EMM_ZOO.CARS.CARID = '" . $carID . "';";
        $borrow = "INSERT INTO EMM_ZOO.CARS_BORROWED(BORROWNO, CARID, EMPID, BORROWDATE,RETURNDATE) VALUES (DEFAULT,?,?,?,?);";
        echo $sql;
        // prepare statement using connection and sql
        $stborrow = db2_prepare($conn, $borrow);
        $stmt = db2_prepare($conn, $sql);
        $result3 = dbQuery($conn, $sql2);
        $row = dbFetchArray($conn, $result3);
        if ($start > $end) {
            echo "<script type='text/javascript'>alert(' You need to return after borrow date');</script>";
            header("Refresh:0; url=transportation_animal.php");
        } else {
            if ($row[0] == 'N') {
                echo "<script type='text/javascript'>alert('This car is not available to borrow');</script>";
                header("Refresh:0; url=transportation_animal.php");
            } else {
                // If statement is valid execute it to db2
                if ($stmt) {
                    //echo "SQL is valid<br>";
                    $result = db2_execute($stmt, $data);
                    if ($result) {
                        $resultMessage = "Successfully";
                        $result2 = db2_exec($conn, $update);
                        if ($result2) {
                            print "Updated successfully\n";
                            if ($stborrow) {
                                //echo "SQL is valid<br>";
                                $result9 = db2_execute($stborrow, $databorrow);
                                if ($result9) {
                                    $resultMessage = "Successfully";
                                } else {
                                }
                            }
                            echo "<script type='text/javascript'>alert('CAR BORROWING SUCCESSFUL');</script>";
                            //echo "Successfully added";
                            header("Refresh:0; url=transportation_animal.php");
                        }
                    } else {
                        echo "<script type='text/javascript'>alert('You need to fill all input OR Your employeeID,carID,animalID,approvalID does not exist');</script>";
                        header("Refresh:0; url=transportation_animal.php");
                        $resultMessage = "Failed to query into database";
                    }
                } else {
                    // If statement is error why see the code
                    die('Critical error:' . db2_stmt_error($stmt));
                }
            }
        }
        db2_free_stmt($stborrow);
        db2_free_stmt($stmt);
        db2_close($conn);
    } else {
        echo db2_conn_errormsg($conn);
    }
}
Exemplo n.º 24
0
  <div class="dashboardBox" id="storefront-quick">
    <h3 class="handle"><span>Communication</span></h3>
    <div class="dashboardBoxInside">
    	<div class="table">
		<table width="100%" cellpadding="5" cellspacing="0">
        	<tr>
            	<td colspan="2" class="tableTitle">Pending Newsletters</td>
            </tr>
            <tr>
            	<td class="tableHeader">Subject</td>
                <td align="right" class="tableHeader">Release Date</td>
            </tr>
			<?
			$pendingNewsletters = dbQuery('SELECT email_queue_release_date, email_queue_subject FROM email_queue WHERE email_queue_status = "pending" ORDER BY email_queue_release_date ASC');
			if(dbNumRows($pendingNewsletters)) {
				while($pnInfo = dbFetchArray($pendingNewsletters)) {
					?>
					<tr>
					  <td width="25%" nowrap="nowrap"><?php 
echo output($pnInfo['email_queue_subject']);
?>
</td>
					  <td align="right"><?php 
echo date('m/d/Y', $pnInfo['email_queue_release_date']);
?>
</td>
					</tr>
					<?						 
				}
			} else {
			  ?>
Exemplo n.º 25
0
	theme_advanced_toolbar_location : "top",
	theme_advanced_toolbar_align : "left",
	theme_advanced_statusbar_location : "bottom",
	inline_styles : true,
	theme_advanced_resizing : true,
	forced_root_block : '',
	keep_styles : true,
	inline : "yes",
	template_templates: 
	[
	<?
	/* Output all template here. */
	$templateResults = dbQuery('SELECT * FROM email_templates');
	$templateCount = dbNumRows($templateResults);
	$rowCount = 1;
	while($template = dbFetchArray($templateResults)) {
		//output the template stuff!
		echo "{\n";
		echo "title : '" .output($template['email_templates_name'])."',\n";
		echo "src : 'communication_template_loader.php?id=".$template['email_templates_id']."',\n";
		echo "description: '" . output($template['email_templates_desc'])."'\n";
		if($rowCount == $templateCount) echo "}\n"; else echo "},\n"; //determines if we are at the last record (we don't want to teh comma on the last record.
		
	$rowCount++;
	}
	?>
	],
	formats : {
		heading_text : { inline : 'span', styles : { color : '#6c522c', fontSize : '18px', fontWeight : 'normal'} },
		subheading_text : { inline : 'span', styles : { color : '#333333', fontSize : '14px', fontWeight : 'bold'} },
		reg_text : { inline : 'span', styles : { color : '#1a1a1a', fontSize : '12px', fontWeight : 'normal'} }
Exemplo n.º 26
0
function Borrow()
{
    $up = "N";
    if (isset($_POST)) {
        $empID = $_POST['empID'];
        $carID = $_POST['carID'];
        $start = $_POST['start'];
        $end = $_POST['end'];
        // an array that want to insert this can be multiple array at the time.
        $data = array($carID, $empID, $start, $end);
        //$data2 = array($carID);
        // print var_dump to display an array of variable data with type that prepare for query.
        //echo var_dump($data) ."<br>";
    }
    // define $conn from model
    $conn = dbConnect();
    if ($conn) {
        // DEFAULT if you set generated as identify with specifier this will auto increament for integer.
        $sql = "INSERT INTO EMM_ZOO.CARS_BORROWED(BORROWNO, CARID, EMPID, BORROWDATE,RETURNDATE) VALUES (DEFAULT,?,?,?,?);";
        $update = "UPDATE EMM_ZOO.CARS SET EMM_ZOO.CARS.AVAILABLE = '" . $up . "' WHERE EMM_ZOO.CARS.CARID = '" . $carID . "';";
        $sql2 = "SELECT AVAILABLE FROM EMM_ZOO.CARS WHERE EMM_ZOO.CARS.CARID = '" . $carID . "';";
        // prepare statement using connection and sql
        $stmt = db2_prepare($conn, $sql);
        //$stmt2 = db2_prepare($conn, $sql2);
        // If statement is valid execute it to db2
        $result3 = dbQuery($conn, $sql2);
        $row = dbFetchArray($conn, $result3);
        if ($start > $end) {
            echo "<script type='text/javascript'>alert('You need to return after borrow date');</script>";
            header("Refresh:0; url=TransportationEmployee.php");
        } else {
            if ($row[0] == 'N') {
                echo "<script type='text/javascript'>alert('This car is not available to borrow');</script>";
                header("Refresh:0; url=TransportationEmployee.php");
            } else {
                if ($stmt) {
                    //echo "SQL is valid<br>";
                    $result = db2_execute($stmt, $data);
                    if ($result) {
                        $resultMessage = "Successfully";
                        $result2 = db2_exec($conn, $update);
                        if ($result2) {
                            print "Updated successfully\n";
                        }
                        echo "<script type='text/javascript'>alert('CAR BORROWING SUCCESSFUL');</script>";
                        //echo "Successfully added";
                        header("Refresh:0; url=TransportationEmployee.php");
                        // you must refresh page after insert, define specific page you want to refresh , header("Refresh:0"); it mean refresh current page
                    } else {
                        echo "<script type='text/javascript'>alert('You need to fill all input OR Your employeeID,carID does not exist');</script>";
                        header("Refresh:0; url=TransportationEmployee.php");
                        //  $resultMessage = "Failed to query into database";
                    }
                } else {
                    // If statement is error why see the code
                    die('Critical error:' . db2_stmt_error($stmt));
                }
            }
        }
        db2_free_stmt($stmt);
        db2_free_stmt($result3);
        db2_close($conn);
    } else {
        echo db2_conn_errormsg($conn);
    }
}
Exemplo n.º 27
0
<?php

include 'dbInterface.php';
$con = dbConnect();
$sql = "SELECT idProduto, nomeProduto FROM produto";
$result = dbExecQuery($sql, $con);
echo '<option value=""></option>';
while ($row = dbFetchArray($result)) {
    $str = '<option value="' . $row['idProduto'] . '">';
    $len = strlen($row['idProduto']);
    $id = $len == 1 ? "000" : ($len == 2 ? "00" : ($len == 3 ? "0" : ""));
    $id = "{$id}" . $row['idProduto'];
    $str .= $id . ' - ' . $row['nomeProduto'];
    $str .= '</option>';
    echo $str;
}
dbCloseConnection($con);
Exemplo n.º 28
0
function buildCategoryOptionss($catId = 0)
{
    $sql = "SELECT cat_id, cat_parent_id, cat_name\n\t\t\tFROM tbl_category\n\t\t\tORDER BY cat_id";
    $result = dbQuery($sql) or die('Cannot get Product. ' . mysql_error());
    $categories = array();
    while ($row = dbFetchArray($result)) {
        list($id, $parentId, $name) = $row;
        if ($parentId == 0) {
            // we create a new array for each top level categories
            $categories[$id] = array('name' => $name, 'children' => array());
        } else {
            // the child categories are put int the parent category's array
            $categories[$parentId]['children'][] = array('id' => $id, 'name' => $name);
        }
    }
    // build combo box options
    $list = '';
    foreach ($categories as $key => $value) {
        $name = $value['name'];
        $children = $value['children'];
        $parent = checkcat($name);
        $pname = $parent['cat_id'];
        //                $cat_name=$parent['cat_name'];
        $list .= "<option value=\"{$pname}\">{$name}</option>";
        //	foreach ($children as $child) {
        // 		$list .= "<option value=\"{$child['id']}\"";
        // 			if ($child['id'] == $catId) {
        // 				$list.= " selected";
        // 			}
        //
        // 			$list .= ">---->{$child['name']}</option>\r\n";
        // 		}
        //
        //		$list .= "</optgroup>";
    }
    return $list;
}
Exemplo n.º 29
0
            <p style="color:white">We Care for Animals.</p>
          </div>

        <?php 
// include (dirname(__FILE__).'/app/model/connect.php');
require_once '../model/connect.php';
if ($conn) {
    $sql = "SELECT DISTINCT ea.empid, e.firstname, e.lastname, j.jobtype\n              FROM EMM_ZOO.EMPFORANIMAL as ea, EMM_ZOO.EMPLOYEE as e, EMM_ZOO.JOB as j\n              WHERE ea.empid = e.empid and e.jobid = j.jobid;";
    $stmt = dbQuery($conn, $sql);
    if ($stmt == FALSE) {
        die('Critical error: ' . db2_stmt_error($stmt));
    }
    echo "<table id='aniinfo' class='display responsive' cellspacing='0' width='100%' role='grid'>\n";
    echo "<thead>\n            <tr>\n              <th>FIRSTNAME</th>\n              <th>LASTNAME</th>\n              <th>JOB</th>\n            </tr>\n          </thead>";
    echo "<tbody>";
    while ($row = dbFetchArray($conn, $stmt)) {
        echo "\t<tr>\n        \n            <td align=\"center\">{$row['1']}</td>\n            <td align=\"center\">{$row['2']}</td>\n            <td align=\"center\">{$row['3']}</td>\n          </tr>\n";
    }
    echo "</tbody>";
    echo "</table>\n";
    db2_free_stmt($stmt);
    db2_close($conn);
} else {
    echo "Connection failed" . db2_conn_errormsg($conn);
}
?>

  </body>


</html>
Exemplo n.º 30
0
          <thead><tr>
                <th>ID</th>
                <th>RegNo</th>
                <th>Check In</th>
                <th>Check Out</th>
                <th>Dates</th>
                <th>Fee</th>
          </tr></thead>
          <tbody id="ReserveTable">
            <?php 
$conn = dbConnect();
if ($conn) {
    $sql = "SELECT * FROM EMM_ZOO.PARKHISTORY;";
    $stmt = dbQuery($conn, $sql);
    $count = 0;
    while ($row = dbFetchArray($conn, $stmt, array('cursor' => DB2_SCROLLABLE))) {
        $count++;
        print "\t<tr><td>{$row['0']}</td><td>{$row['1']}</td><td>{$row['2']}</td><td>{$row['3']}</td><td>{$row['4']}</td><td>{$row['5']}</td></tr>\n";
    }
    if ($count == 0) {
        print "\t<tr><td colspan='6' class='center'>No car park history found</tr>\n";
    }
    db2_free_stmt($stmt);
    db2_close($conn);
} else {
    echo "Connection failed" . db2_conn_errormsg($conn);
}
?>
            </table>
            </div>
            <div class="row center">